Imported Upstream version 0.10.0
Andreas Henriksson
13 years ago
0 | 2008-12-03 Jorn Baayen <jorn.baayen@collabora.co.uk> | |
1 | ||
2 | * tests/test-browser.c (main): | |
3 | * tests/test-publish.c (main): | |
4 | * tools/gssdp-device-sniffer.c (init_upnp): | |
5 | ||
6 | Use g_printerr() and EXIT_{SUCCESS,FAILURE}. | |
7 | ||
8 | 2008-12-03 Jorn Baayen <jorn.baayen@collabora.co.uk> | |
9 | ||
10 | * libgssdp/gssdp-resource-group.c (message_received_cb): | |
11 | ||
12 | "All SSDP services MUST respond to SEARCH requests over the SSDP | |
13 | multicast channel/port with the ST value of ssdp:all by responding | |
14 | as if the ST value had been their service type. " | |
15 | ||
16 | Thanks Hugo Calleja. Fixes #1312. | |
17 | ||
18 | 2008-11-21 Jorn Baayen <jorn.baayen@collabora.co.uk> | |
19 | ||
20 | * AUTHORS: | |
21 | ||
22 | New e-mail address. | |
23 | ||
24 | * libgssdp/gssdp-resource-group.c (gssdp_resource_group_dispose), | |
25 | (gssdp_resource_group_class_init), | |
26 | (gssdp_resource_group_add_resource), (process_queue), | |
27 | (queue_message), (resource_alive), (resource_byebye): | |
28 | ||
29 | Do not byebye unavailable resources. | |
30 | (And polish message delaying code a little) | |
31 | ||
32 | 2008-11-19 Jussi Kukkonen <jku@linux.intel.com> | |
33 | ||
34 | * libgssdp/gssdp-resource-group.c: | |
35 | ||
36 | Make gssdp_resource_group_queue_message() static as well. | |
37 | ||
38 | 2008-11-19 Jussi Kukkonen <jku@linux.intel.com> | |
39 | ||
40 | * libgssdp/gssdp-resource-group.c: | |
41 | ||
42 | Send byebyes in dispose without sleep: DLNA message delay is | |
43 | only mandatory for alive-messages after all. | |
44 | Make process_queue() static. | |
45 | ||
46 | 2008-11-18 Jorn Baayen <jorn.baayen@collabora.co.uk> | |
47 | ||
48 | * configure.ac: | |
49 | ||
50 | Depend on glib 2.18. | |
51 | ||
52 | * libgssdp/gssdp-client.c (gssdp_client_set_property): | |
53 | ||
54 | Use g_set_error_literal(). | |
55 | ||
56 | 2008-11-06 Jussi Kukkonen <jku@linux.intel.com> | |
57 | ||
58 | * doc/gssdp-sections.txt: | |
59 | * libgssdp/gssdp-client.c (gssdp_client_new): | |
60 | * libgssdp/gssdp-client.h (gssdp_client_new): | |
61 | * libgssdp/gssdp-error.c (gssdp_error_quark): | |
62 | * libgssdp/gssdp-resource-group.c (gssdp_resource_group_get_client): | |
63 | ||
64 | Documentation fixes | |
65 | ||
66 | 2008-11-06 Jussi Kukkonen <jku@linux.intel.com> | |
67 | ||
68 | * libgssdp/gssdp-resource-group.c: | |
69 | ||
70 | Only send one SSDP message per X milliseconds (X == 20 by default) | |
71 | ||
72 | 2008-11-06 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | |
73 | ||
74 | * AUTHORS: | |
75 | * tools/gssdp-device-sniffer.c: | |
76 | * tools/gssdp-device-sniffer.glade: | |
77 | ||
78 | Replace my non-working "@gstreamer.net" email with "@gnome.org" one. | |
79 | ||
80 | 2008-10-29 Jussi Kukkonen <jku@linux.intel.com> | |
81 | ||
82 | * libgssdp/gssdp-resource-group.c (resource_alive): | |
83 | ||
84 | send ssdp:byebye before sending the first ssdp:alive. | |
85 | ||
86 | 2008-10-27 Ross Burton <ross@linux.intel.com> | |
87 | ||
88 | * NEWS: | |
89 | * configure.ac: | |
90 | Version 0.6.3. | |
91 | ||
92 | 2008-10-27 Ross Burton <ross@linux.intel.com> | |
93 | ||
94 | * doc/Makefile.am: | |
95 | Add version.xml to content_files so building docs in distcheck works. | |
96 | ||
97 | 2008-10-27 Ross Burton <ross@linux.intel.com> | |
98 | ||
99 | * Makefile.am: | |
100 | Enable gtk-doc in distcheck. | |
101 | ||
102 | 2008-10-27 Ross Burton <ross@linux.intel.com> | |
103 | ||
104 | * libgssdp/gssdp-resource-browser.c: | |
105 | Don't use NULL return values from g_get_application_name() (#1177). | |
106 | ||
107 | 2008-09-27 Jorn Baayen <jorn@openedhand.com> | |
108 | ||
109 | * configure.ac: | |
110 | ||
111 | Increase version number. | |
112 | ||
113 | 2008-09-27 Jorn Baayen <jorn@openedhand.com> | |
114 | ||
115 | * libgssdp/gssdp-resource-browser.c (resource_available), | |
116 | (resource_free), (discovery_timeout), (start_discovery), | |
117 | (stop_discovery): | |
118 | * libgssdp/gssdp-resource-group.c (gssdp_resource_group_dispose), | |
119 | (gssdp_resource_group_set_available), (message_received_cb), | |
120 | (discovery_response_free): | |
121 | ||
122 | Use the specified GMainContext for timeouts. | |
123 | ||
124 | Based on a patch from Olivier Crete <olivier.crete@collabora.co.uk>. | |
125 | ||
126 | 2008-08-31 Jorn Baayen <jorn@openedhand.com> | |
127 | ||
128 | * configure.ac: | |
129 | * NEWS: | |
130 | ||
131 | Release 0.6.2 | |
132 | ||
133 | 2008-08-12 Zeeshan Ali Khattak <zeenix@gmail.com> | |
134 | ||
135 | * tools/gssdp-device-sniffer.c: | |
136 | ||
137 | Remove the unneeded call to g_thread_init(). | |
138 | ||
139 | 2008-07-11 Jorn Baayen <jorn@openedhand.com> | |
140 | ||
141 | * libgssdp/gssdp-resource-group.c | |
142 | (gssdp_resource_group_set_available): | |
143 | Reannounce after max_age / 2 - 1 instead of after max_age, as per | |
144 | UPnP specs. Based on a patch by Peter Christensen | |
145 | <peter@developers.dk>. | |
146 | ||
147 | 2008-05-23 Ross Burton <ross@openedhand.com> | |
148 | ||
149 | * libgssdp/gssdp-socket-source.c: | |
150 | Make the GSourceFuncs static const. | |
151 | ||
152 | 2008-05-19 Jorn Baayen <jorn@openedhand.com> | |
153 | ||
154 | * NEWS: | |
155 | * configure.ac: | |
156 | * libgssdp/Makefile.am: | |
157 | ||
158 | Bump soname and release 0.6.1. | |
159 | ||
160 | 2008-05-13 Jorn Baayen <jorn@openedhand.com> | |
161 | ||
162 | * doc/gssdp.types: | |
163 | ||
164 | Add types file so that introspection works. | |
165 | ||
166 | 2008-05-13 Jorn Baayen <jorn@openedhand.com> | |
167 | ||
168 | * NEWS: | |
169 | * configure.ac: | |
170 | ||
171 | Release gssdp 0.6. | |
172 | ||
173 | 2008-04-15 Jorn Baayen <jorn@openedhand.com> | |
174 | ||
175 | * libgssdp/gssdp-resource-browser.c (resource_available): | |
176 | * libgssdp/gssdp-resource-group.c | |
177 | (gssdp_resource_group_set_available): | |
178 | ||
179 | Use g_timeout_add_seconds(). We can because soup 2.4 depends | |
180 | on glib 2.16. | |
181 | ||
182 | 2008-04-15 Jorn Baayen <jorn@openedhand.com> | |
183 | ||
184 | * gssdp-1.0-uninstalled.pc.in: | |
185 | * gssdp-1.0.pc.in: | |
186 | ||
187 | Update for soup 2.4. | |
188 | ||
189 | 2008-04-14 Zeeshan Ali Khattak <zeenix@gmail.com> | |
190 | ||
191 | * configure.ac: | |
192 | * libgssdp/gssdp-client.c (parse_http_request), | |
193 | (parse_http_response), (socket_source_cb): | |
194 | * libgssdp/gssdp-resource-browser.c (resource_available), | |
195 | (resource_unavailable), (received_discovery_response), | |
196 | (received_announcement), (message_received_cb): | |
197 | * libgssdp/gssdp-resource-group.c (message_received_cb), | |
198 | (discovery_response_timeout): | |
199 | * tools/Makefile.am: | |
200 | * tools/gssdp-device-sniffer.c (packet_header_to_string), | |
201 | (display_packet), (on_packet_selected), (packet_to_treeview_data), | |
202 | (append_packet), (on_ssdp_message), (create_packet_treemodel): | |
203 | ||
204 | Port to libsoup 2.4. | |
205 | ||
206 | 2008-03-12 Zeeshan Ali Khattak <zeenix@gmail.com> | |
207 | ||
208 | * configure.ac: | |
209 | ||
210 | Require correct version of libsoup (>= 2.2.100). | |
211 | ||
212 | 2008-02-26 Jorn Baayen <jorn@openedhand.com> | |
213 | ||
214 | * autogen.sh: | |
215 | ||
216 | Don't call glib-gettextize. | |
217 | ||
218 | 2008-02-24 Jorn Baayen <jorn@openedhand.com> | |
219 | ||
220 | * configure.ac: | |
221 | ||
222 | Remove last trace of unused i18n. | |
223 | ||
224 | 2008-02-23 Jorn Baayen <jorn@openedhand.com> | |
225 | ||
226 | * NEWS: | |
227 | * configure.ac: | |
228 | ||
229 | Release 0.4.2. | |
230 | ||
231 | 2008-02-09 Zeeshan Ali Khattak <zeenix@gstreamer.net> | |
232 | ||
233 | * tools/gssdp-device-sniffer.c: | |
234 | ||
235 | Add port argument to 'message-received' callback function. | |
236 | ||
237 | 2008-02-09 Jorn Baayen <jorn@openedhand.com> | |
238 | ||
239 | * libgssdp/gssdp-protocol.h: | |
240 | * libgssdp/gssdp-resource-browser.c: (send_discovery_request): | |
241 | ||
242 | Include g_get_application_name() in "User-Agent" header. | |
243 | ||
244 | 2008-02-09 Jorn Baayen <jorn@openedhand.com> | |
245 | ||
246 | * libgssdp/gssdp-protocol.h: | |
247 | ||
248 | Add "User-Agent" header to discovery request. | |
249 | ||
250 | 2008-02-02 Jorn Baayen <jorn@openedhand.com> | |
251 | ||
252 | * libgssdp/gssdp-client.c: (gssdp_client_init), | |
253 | (gssdp_client_set_property), (gssdp_client_dispose), | |
254 | (gssdp_client_new), (gssdp_client_set_main_context), | |
255 | (_gssdp_client_send_message), (string_list_free), (header_hash), | |
256 | (header_equal), (socket_source_cb): | |
257 | * libgssdp/gssdp-socket-source.c: (gssdp_socket_source_new): | |
258 | * libgssdp/gssdp-socket-source.h: | |
259 | ||
260 | Send SSDP messages from dynamic port. | |
261 | ||
262 | 2008-02-01 Jorn Baayen <jorn@openedhand.com> | |
263 | ||
264 | * libgssdp/gssdp-resource-browser.c: | |
265 | (gssdp_resource_browser_set_property), | |
266 | (gssdp_resource_browser_dispose), | |
267 | (gssdp_resource_browser_set_active), (clear_cache): | |
268 | ||
269 | Emit multiple M-SEARCH requests because UDP is unreliable. | |
270 | Based on a patch by Zeeshan Ali. | |
271 | ||
272 | 2008-01-31 Jorn Baayen <jorn@openedhand.com> | |
273 | ||
274 | * libgssdp/gssdp-client-private.h: | |
275 | * libgssdp/gssdp-client.c: (gssdp_client_class_init), | |
276 | (_gssdp_client_send_message), (socket_source_cb): | |
277 | * libgssdp/gssdp-marshal.list: | |
278 | * libgssdp/gssdp-protocol.h: | |
279 | * libgssdp/gssdp-resource-browser.c: | |
280 | (gssdp_resource_browser_set_active): | |
281 | * libgssdp/gssdp-resource-group.c: (resource_group_timeout), | |
282 | (message_received_cb), (construct_al), | |
283 | (discovery_response_timeout), (resource_alive), (resource_byebye): | |
284 | * libgssdp/gssdp-socket-source.h: | |
285 | ||
286 | - Send discovery response to port of origin instead of to SSDP port. | |
287 | - Add Date header to discovery response. | |
288 | - Add missing G_GNUC_INTERNALs. | |
289 | ||
290 | 2008-01-14 Jorn Baayen <jorn@openedhand.com> | |
291 | ||
292 | * Makefile.am: | |
293 | * configure.ac: | |
294 | ||
295 | Remove unused translation framework. | |
296 | ||
297 | 2007-09-23 Jorn Baayen <jorn@openedhand.com> | |
298 | ||
299 | * NEWS: | |
300 | * configure.ac: | |
301 | ||
302 | Release 0.4.1. | |
303 | ||
304 | 2007-09-11 Zeeshan Ali <zeenix@gstreamer.net> | |
305 | ||
306 | * tools/gssdp-device-sniffer.c: (setup_treeviews): | |
307 | ||
308 | Pass the correct value to n_columns argument of | |
309 | gtk_list_store_new(). Fixes bug#501. | |
310 | ||
311 | 2007-09-10 Zeeshan Ali <zeenix@gstreamer.net> | |
312 | ||
313 | * tools/gssdp-device-sniffer.c: (setup_treeviews): | |
314 | ||
315 | Make sure treemodels get created at the startup. | |
316 | ||
317 | 2007-08-23 Jorn Baayen <jorn@openedhand.com> | |
318 | ||
319 | * gssdp-1.0-uninstalled.pc.in: | |
320 | * gssdp-1.0.pc.in: | |
321 | ||
322 | Move libsoup req to Requires.Private. | |
323 | ||
324 | 2007-07-27 Jorn Baayen <jorn@openedhand.com> | |
325 | ||
326 | * libgssdp/gssdp-client.c: (socket_source_cb): | |
327 | ||
328 | Fix compiler warning. Fixes #421. | |
329 | ||
330 | Patch by Priit Laes. | |
331 | ||
332 | 2007-07-26 Jorn Baayen <jorn@openedhand.com> | |
333 | ||
334 | * NEWS: | |
335 | ||
336 | Updated. | |
337 | ||
338 | * configure.ac: | |
339 | ||
340 | Bump version number to 0.4. | |
341 | ||
342 | 2007-07-26 Jorn Baayen <jorn@openedhand.com> | |
343 | ||
344 | * gssdp-1.0.pc.in: | |
345 | ||
346 | List all dependencies. | |
347 | ||
348 | 2007-07-25 Jorn Baayen <jorn@openedhand.com> | |
349 | ||
350 | * doc/gssdp-sections.txt: | |
351 | * libgssdp/gssdp-error.c: | |
352 | ||
353 | Doc polish. | |
354 | ||
355 | 2007-07-25 Jorn Baayen <jorn@openedhand.com> | |
356 | ||
357 | * README: | |
358 | ||
359 | Somewhat better description. | |
360 | ||
361 | 2007-07-24 Jorn Baayen <jorn@openedhand.com> | |
362 | ||
363 | * NEWS: | |
364 | * configure.ac: | |
365 | ||
366 | Release 0.3. | |
367 | ||
368 | 2007-07-08 Jorn Baayen <jorn@openedhand.com> | |
369 | ||
370 | * libgssdp/gssdp-protocol.h: | |
371 | ||
372 | s/bye-bye/byebye. | |
373 | ||
374 | * libgssdp/gssdp-resource-group.c: (gssdp_resource_group_dispose): | |
375 | ||
376 | byebye resources before unreffing client. | |
377 | ||
378 | 2007-07-03 Jorn Baayen <jorn@openedhand.com> | |
379 | ||
380 | * NEWS: | |
381 | * configure.ac: | |
382 | ||
383 | Release 0.2. | |
384 | ||
385 | 2007-06-30 Jorn Baayen <jorn@openedhand.com> | |
386 | ||
387 | * libgssdp/gssdp-error.c: (gssdp_error_quark): | |
388 | ||
389 | Change quark name for consistency. | |
390 | ||
391 | 2007-06-30 Jorn Baayen <jorn@openedhand.com> | |
392 | ||
393 | * libgssdp/gssdp-client.c: (gssdp_client_set_property): | |
394 | * libgssdp/gssdp-error.h: | |
395 | * libgssdp/gssdp-resource-browser.c: | |
396 | * libgssdp/gssdp-resource-group.c: | |
397 | ||
398 | Use error codes. | |
399 | ||
400 | 2007-06-30 Jorn Baayen <jorn@openedhand.com> | |
401 | ||
402 | * libgssdp/gssdp-resource-browser.c: (resource_available): | |
403 | ||
404 | Use SoupDate for Expires header support. | |
405 | ||
406 | 2007-06-13 Ross Burton <ross@openedhand.com> | |
407 | ||
408 | * configure.ac: | |
409 | Use --without-libglade rather than --disable-libglade. | |
410 | ||
411 | 2007-06-13 Ross Burton <ross@openedhand.com> | |
412 | ||
413 | * tools/Makefile.am: | |
414 | Dist the glade. | |
415 | ||
416 | 2007-05-26 Jorn Baayen <jorn@openedhand.com> | |
417 | ||
418 | * libgssdp/gssdp-client.c: | |
419 | * libgssdp/gssdp-client.h: | |
420 | * libgssdp/gssdp-error.c: | |
421 | * libgssdp/gssdp-resource-browser.c: | |
422 | * libgssdp/gssdp-resource-browser.h: | |
423 | * libgssdp/gssdp-resource-group.c: | |
424 | * libgssdp/gssdp-resource-group.h: | |
425 | ||
426 | gtkdoc-fu. | |
427 | ||
428 | 2007-05-26 Jorn Baayen <jorn@openedhand.com> | |
429 | ||
430 | * configure.ac: | |
431 | * doc/Makefile.am: | |
432 | * doc/gssdp-docs.sgml: | |
433 | ||
434 | Added doc preamble. | |
435 | ||
436 | 2007-05-21 Jorn Baayen <jorn@openedhand.com> | |
437 | ||
438 | * libgssdp/gssdp-client.c: (gssdp_client_class_init): | |
439 | * libgssdp/gssdp-client.h: | |
440 | * libgssdp/gssdp-error.c: | |
441 | * libgssdp/gssdp-resource-browser.c: | |
442 | (gssdp_resource_browser_class_init): | |
443 | * libgssdp/gssdp-resource-browser.h: | |
444 | * libgssdp/gssdp-resource-group.c: | |
445 | (gssdp_resource_group_class_init), | |
446 | (gssdp_resource_group_get_max_age): | |
447 | * libgssdp/gssdp-resource-group.h: | |
448 | ||
449 | Doc coverage to 100%. | |
450 | ||
451 | 2007-05-21 Jorn Baayen <jorn@openedhand.com> | |
452 | ||
453 | * doc/Makefile.am: | |
454 | ||
455 | Exclude private bits. | |
456 | ||
457 | * doc/gssdp-docs.sgml: | |
458 | ||
459 | Add title. | |
460 | ||
461 | * libgssdp/gssdp-client.c: (gssdp_client_class_init): | |
462 | ||
463 | Mark 'message-received' as private. | |
464 | ||
465 | 2007-05-21 Jorn Baayen <jorn@openedhand.com> | |
466 | ||
467 | * configure.ac: | |
468 | ||
469 | Point to gupnp.org. | |
470 | ||
471 | * tools/Makefile.am: | |
472 | ||
473 | Include path to glade file. | |
474 | ||
475 | * po/*: | |
476 | ||
477 | Added missing files. | |
478 | ||
479 | 2007-05-21 Jorn Baayen <jorn@openedhand.com> | |
480 | ||
481 | * tools/gssdp-device-sniffer.glade: | |
482 | ||
483 | Some UI cleanup. | |
484 | ||
485 | 2007-05-20 Zeeshan Ali <zeenix@gstreamer.net> | |
486 | ||
487 | * tools/gssdp-device-sniffer.c: (append_device), | |
488 | (resource_available_cb), (create_device_treemodel), | |
489 | (setup_treeviews): | |
490 | ||
491 | Replace 'Notify' and 'Last Notify' fields with 'First Notify'. | |
492 | ||
493 | 2007-05-19 Jorn Baayen <jorn@openedhand.com> | |
494 | ||
495 | * tools/gssdp-device-sniffer.glade: | |
496 | ||
497 | Fix about box closing. | |
498 | ||
499 | 2007-05-19 Zeeshan Ali <zeenix@gstreamer.net> | |
500 | ||
501 | * tools/gssdp-device-sniffer.c: (init_ui): | |
502 | ||
503 | device-sniffer should test of the existance of the glade file itself, | |
504 | to avoid warning messages from libglade. | |
505 | ||
506 | 2007-05-16 Zeeshan Ali <zeenix@gstreamer.net> | |
507 | ||
508 | * tools/gssdp-device-sniffer.c: (append_device), | |
509 | (resource_available_cb): | |
510 | ||
511 | Append the device to the device treeview even when all details are not | |
512 | yet known. | |
513 | ||
514 | * tools/gssdp-device-sniffer.glade: | |
515 | ||
516 | Fix the closing of dialog. | |
517 | ||
518 | 2007-05-15 Zeeshan Ali <zeenix@gstreamer.net> | |
519 | ||
520 | reviewed by: Jorn Baayen <jorn@openedhand.com> | |
521 | ||
522 | * tools/gssdp-device-sniffer.c: (packet_to_treeview_data), | |
523 | (on_enable_packet_capture_activate), (packet_to_treeview_data), | |
524 | (on_ssdp_message): | |
525 | * tools/gssdp-device-sniffer.glade: | |
526 | ||
527 | - Implement start/stop of packet capturing. | |
528 | - Ignore discovery request packets rather than response packets. | |
529 | - Minor UI fixes. | |
530 | ||
531 | 2007-05-11 Jorn Baayen <jorn@openedhand.com> | |
532 | ||
533 | * AUTHORS: Added Zeeshan. | |
534 | ||
535 | 2007-05-11 Zeeshan Ali <zeenix@gstreamer.net> | |
536 | ||
537 | * tools/gssdp-device-sniffer.c: (on_ssdp_message), | |
538 | (on_use_filter_radiobutton_toggled), (get_ip_filter), | |
539 | (on_address_filter_dialog_response), (init_ui), (init_upnp): | |
540 | * tools/gssdp-device-sniffer.glade: | |
541 | ||
542 | - Correctly handle delete-event. | |
543 | - Fix initial size of the window. | |
544 | - Add support for IP-filtering of packets. | |
545 | - Do active the resource-browser. | |
546 | - Add copyright header. | |
547 | ||
548 | 2007-05-11 Zeeshan Ali <zeenix@gstreamer.net> | |
549 | ||
550 | * tools/gssdp-device-sniffer.c: (append_device), (find_device), | |
551 | (update_device), (resource_available_cb), (remove_device), | |
552 | (resource_unavailable_cb), (create_packet_treemodel), | |
553 | (create_device_treemodel), (setup_treeview), (setup_treeviews), | |
554 | (init_upnp), (main): | |
555 | * tools/gssdp-device-sniffer.glade: | |
556 | ||
557 | - Remove unimplementable menu items and the associated callbacks. | |
558 | - Implement device view. | |
559 | - Deinit gssdp objects first rather than the UI. | |
560 | - Some minor fixes. | |
561 | ||
562 | 2007-05-10 Jorn Baayen <jorn@openedhand.com> | |
563 | ||
564 | * NEWS: | |
565 | * README: | |
566 | ||
567 | Added some text. | |
568 | ||
569 | 2007-05-10 Jorn Baayen <jorn@openedhand.com> | |
570 | ||
571 | * Makefile.am: | |
572 | ||
573 | Do not install uninstalled PC file. | |
574 | ||
575 | 2007-05-09 Jorn Baayen <jorn@openedhand.com> | |
576 | ||
577 | * libgssdp/gssdp-resource-browser.c: (resource_available): | |
578 | ||
579 | Disable support for Expires header for now as correct RFC 1123 parsing | |
580 | is a pain. | |
581 | ||
582 | 2007-05-08 Zeeshan Ali <zeenix@gstreamer.net> | |
583 | ||
584 | * tools/gssdp-device-sniffer.c: (clear_packet_treeview), | |
585 | (packet_header_to_string), (clear_textbuffer), | |
586 | (update_packet_details), (display_packet), (on_packet_selected), | |
587 | (on_clear_packet_capture_activate), (packet_to_treeview_data), | |
588 | (append_packet), (on_ssdp_message), (create_model), | |
589 | (setup_treeviews), (init_upnp): | |
590 | ||
591 | - Implement packet details viewing. | |
592 | - Browsing passively. | |
593 | - Rename on_gssdp_message to on_ssdp_message | |
594 | - Implement clearing of packet info treeview and textview. | |
595 | - Rename clear_packet_capture1 to clear_packet_capture | |
596 | ||
597 | * tools/gssdp-device-sniffer.glade: | |
598 | ||
599 | Rename clear_packet_capture1 to clear_packet_capture | |
600 | ||
601 | 2007-05-08 Zeeshan Ali <zeenix@gstreamer.net> | |
602 | ||
603 | * libgssdp/gssdp-client.c: (socket_source_cb): | |
604 | ||
605 | Unref the table instead of destroying it. | |
606 | ||
607 | 2007-05-07 Jorn Baayen <jorn@openedhand.com> | |
608 | ||
609 | * libgssdp/gssdp-resource-browser.c: (received_discovery_response): | |
610 | ||
611 | Handle standard-uncompliant replies to "ssdp:all" discovery requests | |
612 | gracefully. | |
613 | ||
614 | 2007-05-07 Jorn Baayen <jorn@openedhand.com> | |
615 | ||
616 | * libgssdp/gssdp-resource-browser.c: (resource_available): | |
617 | ||
618 | Allow spaces when parsing Cache-Control. | |
619 | ||
620 | 2007-05-04 Jorn Baayen <jorn@openedhand.com> | |
621 | ||
622 | * libgssdp/gssdp-protocol.h: | |
623 | * libgssdp/gssdp-resource-browser.c: (received_announcement): | |
624 | * libgssdp/gssdp-resource-browser.h: | |
625 | * libgssdp/gssdp-resource-group.c: (message_received_cb): | |
626 | * tests/test-browser.c: (main): | |
627 | * tools/gssdp-device-sniffer.c: (init_upnp): | |
628 | ||
629 | Define GSSDP_ALL_RESOURCES in gupnp-resource-browser.h. | |
630 | ||
631 | 2007-05-04 Jorn Baayen <jorn@openedhand.com> | |
632 | ||
633 | * libgssdp/gssdp-resource-browser.c: (received_announcement): | |
634 | * libgssdp/gssdp-resource-group.c: (message_received_cb), | |
635 | (discovery_response_timeout), (discovery_response_free): | |
636 | ||
637 | More "ssdp:all" work - should be all good now. | |
638 | ||
639 | 2007-05-04 Jorn Baayen <jorn@openedhand.com> | |
640 | ||
641 | * libgssdp/gssdp-protocol.h: | |
642 | * libgssdp/gssdp-resource-group.c: (message_received_cb): | |
643 | * tests/test-browser.c: (main): | |
644 | ||
645 | Handle "ssdp:all" correctly. | |
646 | ||
647 | 2007-05-04 Zeeshan Ali <zeenix@gstreamer.net> | |
648 | ||
649 | * Makefile.am: | |
650 | * configure.ac: | |
651 | * tools/Makefile.am: | |
652 | * tools/gssdp-device-sniffer.c: (on_av_media_servers_1_0_activate), | |
653 | (on_av_renderers_1_0_activate), | |
654 | (on_enable_packet_capture_activate), | |
655 | (on_search_all_devices_activate), | |
656 | (on_clear_packet_capture1_activate), (on_details_activate), | |
657 | (on_filter_menuitem_activate), (on_address_filter_activate), | |
658 | (on_search_root_devices_activate), | |
659 | (on_show_device_tracking_activate), | |
660 | (on_internet_gateways_1_0_activate), (append_packet), | |
661 | (on_gssdp_message), (on_custom_search_dialog_response), | |
662 | (create_model), (setup_treeview), (setup_treeviews), | |
663 | (on_delete_event), (init_ui), (deinit_ui), (init_upnp), | |
664 | (deinit_upnp), (main): | |
665 | * tools/gssdp-device-sniffer.glade: | |
666 | Add a basic version of gssdp-device-sniffer. | |
667 | ||
668 | 2007-05-04 Zeeshan Ali <zeenix@gstreamer.net> | |
669 | ||
670 | * Makefile.am: | |
671 | * configure.ac: | |
672 | * gssdp-1.0-uninstalled.pc.in: Enable the users to build/link against | |
673 | uninstalled gssdp. | |
674 | ||
675 | 2007-05-03 Jorn Baayen <jorn@openedhand.com> | |
676 | ||
677 | * libgssdp/gssdp-protocol.h: | |
678 | * libgssdp/gssdp-resource-browser.c: (received_announcement): | |
679 | Actually, target field is NT for notifications, and ST | |
680 | for searches ... | |
681 | ||
682 | 2007-05-03 Jorn Baayen <jorn@openedhand.com> | |
683 | ||
684 | * libgssdp/gssdp-resource-browser.c: (received_announcement): | |
685 | Target field is ST, not NT. | |
686 | ||
687 | * libgssdp/gssdp-resource-group.c: (message_received_cb): | |
688 | Add comment. | |
689 | ||
690 | 2007-05-03 Jorn Baayen <jorn@openedhand.com> | |
691 | ||
692 | * libgssdp/Makefile.am: | |
693 | * libgssdp/gssdp-client.c: | |
694 | * libgssdp/gssdp-resource-browser.c: | |
695 | (gssdp_resource_browser_get_property), | |
696 | (gssdp_resource_browser_set_property), | |
697 | (gssdp_resource_browser_class_init), (resource_available), | |
698 | (resource_unavailable), (received_discovery_response), | |
699 | (received_announcement), (message_received_cb): | |
700 | * libgssdp/gssdp-resource-browser.h: | |
701 | * libgssdp/gssdp-resource-group.c: | |
702 | (gssdp_resource_group_get_property), | |
703 | (gssdp_resource_group_set_property), | |
704 | (gssdp_resource_group_class_init), | |
705 | (gssdp_resource_group_remove_resource), (message_received_cb), | |
706 | (discovery_response_timeout), (discovery_response_free), | |
707 | (resource_alive), (resource_byebye): | |
708 | * libgssdp/gssdp-resource-group.h: | |
709 | * libgssdp/gssdp-service-browser.c: | |
710 | * libgssdp/gssdp-service-browser.h: | |
711 | * libgssdp/gssdp-service-group.c: | |
712 | * libgssdp/gssdp-service-group.h: | |
713 | * libgssdp/gssdp.h: | |
714 | * tests/test-browser.c: (resource_available_cb), (main): | |
715 | * tests/test-publish.c: (main): | |
716 | ||
717 | Rename ServiceBrowser and ServiceGroup to ResourceBrowser | |
718 | and ServiceGroup as to be consistent with the UPnP book. | |
719 | ||
720 | 2007-04-19 Zeeshan Ali <zeenix@gstreamer.net> | |
721 | ||
722 | * libgssdp/gssdp-client.c: (header_hash), (check_header_equality), | |
723 | (socket_source_cb): HTTP/1.1 headers needs to be case-insensitive and | |
724 | so should be our hash-table of HTTP headers. | |
725 | ||
726 | 2007-04-16 Jorn Baayen <jorn@openedhand.com> | |
727 | ||
728 | * libgssdp/gssdp-client.c: (socket_source_cb): | |
729 | ||
730 | Calculate message length correctly. | |
731 | ||
732 | 2007-04-16 Zeeshan Ali <zeenix@gstreamer.net> | |
733 | ||
734 | * libgssdp/gssdp-socket-source.c: (gssdp_socket_source_new): | |
735 | ||
736 | Allow multiple gssdp clients to exist on the same machine. |
0 | 0.8.2 | |
1 | ===== | |
2 | ||
3 | - Fix some potential crashes. | |
0 | 0.10.0 | |
1 | ====== | |
2 | ||
3 | - Improve interoperability by also announcing lower versions of the service. | |
4 | - More reliable announcements by announcing at least 3 times. | |
5 | - Drop ChangeLog in favour of git history. | |
6 | - Fix IPv6 network calculation. | |
7 | ||
8 | All contributors to this release: | |
9 | ||
10 | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | |
11 | Luis de Bethencourt <luis@debethencourt.com> | |
12 | Jens Georg <mail@jensge.org> | |
13 | ||
14 | 0.9.2 | |
15 | ===== | |
16 | ||
17 | - Fix a critical issue in event handling code introduced in last release. | |
18 | - Add 'network' property to GSSDPClient. By default its set to network IP | |
19 | address of the interface the client is associated with. | |
20 | - Plug some leaks. | |
21 | ||
22 | Changes in dependencies: | |
23 | ||
24 | - Explicitly require libsoup >= 2.26.1. | |
25 | ||
26 | Bugs fixed in this release: | |
27 | ||
28 | 2210 - Socket address leaking in socket_source_cb | |
29 | ||
30 | All contributors to this release: | |
31 | ||
32 | Jens Georg <mail@jensge.org> | |
33 | Sven Neumann <s.neumann@raumfeld.com> | |
34 | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | |
35 | ||
36 | 0.9.1 | |
37 | ===== | |
38 | ||
39 | Another micro release in the unstable 0.9.x branch that brings in all new | |
40 | fixes from the stable 0.8.2 release. | |
41 | ||
42 | All contributors to this release: | |
43 | ||
44 | Sven Neumann <s.neumann@raumfeld.com> | |
45 | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | |
46 | ||
47 | 0.9.0 | |
48 | ===== | |
49 | ||
50 | This release marks the beginning of the new unstable 0.9.x release cycle. | |
51 | Changes after 0.8.0 that were not included in the subsequent stable release: | |
52 | ||
53 | - Port to GIO/GSocket. | |
54 | - Port to Windows. | |
55 | - Don't print the whole packet on failure to send it. | |
56 | - Some other non-functional improvements and fixes. | |
4 | 57 | |
5 | 58 | All Contributors: |
6 | 59 | |
7 | Sven Neumann <s.neumann@raumfeld.com> | |
8 | Zeeshan Ali <zeeshanak@gnome.org> | |
9 | ||
10 | 0.8.1 | |
11 | ===== | |
12 | ||
13 | - Fix build rules of test application for gold linker. | |
14 | - Don't include private header in a public header. | |
15 | ||
16 | Bugs fixed in this release: | |
17 | ||
18 | 2196 - gssdp fails to link with the gold linker. | |
19 | ||
20 | All Contributors: | |
21 | ||
22 | Ross Burton <ross@linux.intel.com> | |
23 | Zeeshan Ali <zeeshanak@gnome.org> | |
60 | Jens Georg <mail@jensge.org> | |
61 | Ross Burton <ross@linux.intel.com> | |
62 | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | |
24 | 63 | |
25 | 64 | 0.8.0 |
26 | 65 | ===== |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.67 for gssdp 0.8.2. | |
2 | # Generated by GNU Autoconf 2.67 for gssdp 0.10.0. | |
3 | 3 | # |
4 | 4 | # Report bugs to <http://www.gupnp.org/>. |
5 | 5 | # |
700 | 700 | # Identity of this package. |
701 | 701 | PACKAGE_NAME='gssdp' |
702 | 702 | PACKAGE_TARNAME='gssdp' |
703 | PACKAGE_VERSION='0.8.2' | |
704 | PACKAGE_STRING='gssdp 0.8.2' | |
703 | PACKAGE_VERSION='0.10.0' | |
704 | PACKAGE_STRING='gssdp 0.10.0' | |
705 | 705 | PACKAGE_BUGREPORT='http://www.gupnp.org/' |
706 | 706 | PACKAGE_URL='' |
707 | 707 | |
760 | 760 | GTKDOC_MKPDF |
761 | 761 | GTKDOC_REBASE |
762 | 762 | GTKDOC_CHECK |
763 | OS_WIN32_FALSE | |
764 | OS_WIN32_TRUE | |
763 | 765 | HAVE_INTROSPECTION_FALSE |
764 | 766 | HAVE_INTROSPECTION_TRUE |
765 | 767 | INTROSPECTION_MAKEFILE |
1461 | 1463 | # Omit some internal or obsolete options to make the list less imposing. |
1462 | 1464 | # This message is too long to be a string in the A/UX 3.1 sh. |
1463 | 1465 | cat <<_ACEOF |
1464 | \`configure' configures gssdp 0.8.2 to adapt to many kinds of systems. | |
1466 | \`configure' configures gssdp 0.10.0 to adapt to many kinds of systems. | |
1465 | 1467 | |
1466 | 1468 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1467 | 1469 | |
1531 | 1533 | |
1532 | 1534 | if test -n "$ac_init_help"; then |
1533 | 1535 | case $ac_init_help in |
1534 | short | recursive ) echo "Configuration of gssdp 0.8.2:";; | |
1536 | short | recursive ) echo "Configuration of gssdp 0.10.0:";; | |
1535 | 1537 | esac |
1536 | 1538 | cat <<\_ACEOF |
1537 | 1539 | |
1648 | 1650 | test -n "$ac_init_help" && exit $ac_status |
1649 | 1651 | if $ac_init_version; then |
1650 | 1652 | cat <<\_ACEOF |
1651 | gssdp configure 0.8.2 | |
1653 | gssdp configure 0.10.0 | |
1652 | 1654 | generated by GNU Autoconf 2.67 |
1653 | 1655 | |
1654 | 1656 | Copyright (C) 2010 Free Software Foundation, Inc. |
1926 | 1928 | This file contains any messages produced by compilers while |
1927 | 1929 | running configure, to aid debugging if configure makes a mistake. |
1928 | 1930 | |
1929 | It was created by gssdp $as_me 0.8.2, which was | |
1931 | It was created by gssdp $as_me 0.10.0, which was | |
1930 | 1932 | generated by GNU Autoconf 2.67. Invocation command line was |
1931 | 1933 | |
1932 | 1934 | $ $0 $@ |
2741 | 2743 | |
2742 | 2744 | # Define the identity of the package. |
2743 | 2745 | PACKAGE='gssdp' |
2744 | VERSION='0.8.2' | |
2746 | VERSION='0.10.0' | |
2745 | 2747 | |
2746 | 2748 | |
2747 | 2749 | cat >>confdefs.h <<_ACEOF |
5431 | 5433 | else |
5432 | 5434 | lt_cv_nm_interface="BSD nm" |
5433 | 5435 | echo "int some_variable = 0;" > conftest.$ac_ext |
5434 | (eval echo "\"\$as_me:5435: $ac_compile\"" >&5) | |
5436 | (eval echo "\"\$as_me:5437: $ac_compile\"" >&5) | |
5435 | 5437 | (eval "$ac_compile" 2>conftest.err) |
5436 | 5438 | cat conftest.err >&5 |
5437 | (eval echo "\"\$as_me:5438: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | |
5439 | (eval echo "\"\$as_me:5440: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | |
5438 | 5440 | (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) |
5439 | 5441 | cat conftest.err >&5 |
5440 | (eval echo "\"\$as_me:5441: output\"" >&5) | |
5442 | (eval echo "\"\$as_me:5443: output\"" >&5) | |
5441 | 5443 | cat conftest.out >&5 |
5442 | 5444 | if $GREP 'External.*some_variable' conftest.out > /dev/null; then |
5443 | 5445 | lt_cv_nm_interface="MS dumpbin" |
6642 | 6644 | ;; |
6643 | 6645 | *-*-irix6*) |
6644 | 6646 | # Find out which ABI we are using. |
6645 | echo '#line 6646 "configure"' > conftest.$ac_ext | |
6647 | echo '#line 6648 "configure"' > conftest.$ac_ext | |
6646 | 6648 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 |
6647 | 6649 | (eval $ac_compile) 2>&5 |
6648 | 6650 | ac_status=$? |
7917 | 7919 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
7918 | 7920 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
7919 | 7921 | -e 's:$: $lt_compiler_flag:'` |
7920 | (eval echo "\"\$as_me:7921: $lt_compile\"" >&5) | |
7922 | (eval echo "\"\$as_me:7923: $lt_compile\"" >&5) | |
7921 | 7923 | (eval "$lt_compile" 2>conftest.err) |
7922 | 7924 | ac_status=$? |
7923 | 7925 | cat conftest.err >&5 |
7924 | echo "$as_me:7925: \$? = $ac_status" >&5 | |
7926 | echo "$as_me:7927: \$? = $ac_status" >&5 | |
7925 | 7927 | if (exit $ac_status) && test -s "$ac_outfile"; then |
7926 | 7928 | # The compiler can only warn and ignore the option if not recognized |
7927 | 7929 | # So say no if there are warnings other than the usual output. |
8256 | 8258 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
8257 | 8259 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
8258 | 8260 | -e 's:$: $lt_compiler_flag:'` |
8259 | (eval echo "\"\$as_me:8260: $lt_compile\"" >&5) | |
8261 | (eval echo "\"\$as_me:8262: $lt_compile\"" >&5) | |
8260 | 8262 | (eval "$lt_compile" 2>conftest.err) |
8261 | 8263 | ac_status=$? |
8262 | 8264 | cat conftest.err >&5 |
8263 | echo "$as_me:8264: \$? = $ac_status" >&5 | |
8265 | echo "$as_me:8266: \$? = $ac_status" >&5 | |
8264 | 8266 | if (exit $ac_status) && test -s "$ac_outfile"; then |
8265 | 8267 | # The compiler can only warn and ignore the option if not recognized |
8266 | 8268 | # So say no if there are warnings other than the usual output. |
8361 | 8363 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
8362 | 8364 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
8363 | 8365 | -e 's:$: $lt_compiler_flag:'` |
8364 | (eval echo "\"\$as_me:8365: $lt_compile\"" >&5) | |
8366 | (eval echo "\"\$as_me:8367: $lt_compile\"" >&5) | |
8365 | 8367 | (eval "$lt_compile" 2>out/conftest.err) |
8366 | 8368 | ac_status=$? |
8367 | 8369 | cat out/conftest.err >&5 |
8368 | echo "$as_me:8369: \$? = $ac_status" >&5 | |
8370 | echo "$as_me:8371: \$? = $ac_status" >&5 | |
8369 | 8371 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
8370 | 8372 | then |
8371 | 8373 | # The compiler can only warn and ignore the option if not recognized |
8416 | 8418 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
8417 | 8419 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
8418 | 8420 | -e 's:$: $lt_compiler_flag:'` |
8419 | (eval echo "\"\$as_me:8420: $lt_compile\"" >&5) | |
8421 | (eval echo "\"\$as_me:8422: $lt_compile\"" >&5) | |
8420 | 8422 | (eval "$lt_compile" 2>out/conftest.err) |
8421 | 8423 | ac_status=$? |
8422 | 8424 | cat out/conftest.err >&5 |
8423 | echo "$as_me:8424: \$? = $ac_status" >&5 | |
8425 | echo "$as_me:8426: \$? = $ac_status" >&5 | |
8424 | 8426 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
8425 | 8427 | then |
8426 | 8428 | # The compiler can only warn and ignore the option if not recognized |
10800 | 10802 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
10801 | 10803 | lt_status=$lt_dlunknown |
10802 | 10804 | cat > conftest.$ac_ext <<_LT_EOF |
10803 | #line 10804 "configure" | |
10805 | #line 10806 "configure" | |
10804 | 10806 | #include "confdefs.h" |
10805 | 10807 | |
10806 | 10808 | #if HAVE_DLFCN_H |
10896 | 10898 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
10897 | 10899 | lt_status=$lt_dlunknown |
10898 | 10900 | cat > conftest.$ac_ext <<_LT_EOF |
10899 | #line 10900 "configure" | |
10901 | #line 10902 "configure" | |
10900 | 10902 | #include "confdefs.h" |
10901 | 10903 | |
10902 | 10904 | #if HAVE_DLFCN_H |
11250 | 11252 | pkg_cv_LIBGSSDP_CFLAGS="$LIBGSSDP_CFLAGS" |
11251 | 11253 | elif test -n "$PKG_CONFIG"; then |
11252 | 11254 | if test -n "$PKG_CONFIG" && \ |
11253 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.18 \\ | |
11254 | gobject-2.0 >= 2.18 \\ | |
11255 | libsoup-2.4\""; } >&5 | |
11256 | ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.18 \ | |
11257 | gobject-2.0 >= 2.18 \ | |
11258 | libsoup-2.4") 2>&5 | |
11255 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.22 \\ | |
11256 | gobject-2.0 >= 2.22 \\ | |
11257 | gio-2.0 >= 2.22 \\ | |
11258 | libsoup-2.4 >= 2.26.1\""; } >&5 | |
11259 | ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.22 \ | |
11260 | gobject-2.0 >= 2.22 \ | |
11261 | gio-2.0 >= 2.22 \ | |
11262 | libsoup-2.4 >= 2.26.1") 2>&5 | |
11259 | 11263 | ac_status=$? |
11260 | 11264 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
11261 | 11265 | test $ac_status = 0; }; then |
11262 | pkg_cv_LIBGSSDP_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.18 \ | |
11263 | gobject-2.0 >= 2.18 \ | |
11264 | libsoup-2.4" 2>/dev/null` | |
11266 | pkg_cv_LIBGSSDP_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.22 \ | |
11267 | gobject-2.0 >= 2.22 \ | |
11268 | gio-2.0 >= 2.22 \ | |
11269 | libsoup-2.4 >= 2.26.1" 2>/dev/null` | |
11265 | 11270 | else |
11266 | 11271 | pkg_failed=yes |
11267 | 11272 | fi |
11272 | 11277 | pkg_cv_LIBGSSDP_LIBS="$LIBGSSDP_LIBS" |
11273 | 11278 | elif test -n "$PKG_CONFIG"; then |
11274 | 11279 | if test -n "$PKG_CONFIG" && \ |
11275 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.18 \\ | |
11276 | gobject-2.0 >= 2.18 \\ | |
11277 | libsoup-2.4\""; } >&5 | |
11278 | ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.18 \ | |
11279 | gobject-2.0 >= 2.18 \ | |
11280 | libsoup-2.4") 2>&5 | |
11280 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.22 \\ | |
11281 | gobject-2.0 >= 2.22 \\ | |
11282 | gio-2.0 >= 2.22 \\ | |
11283 | libsoup-2.4 >= 2.26.1\""; } >&5 | |
11284 | ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.22 \ | |
11285 | gobject-2.0 >= 2.22 \ | |
11286 | gio-2.0 >= 2.22 \ | |
11287 | libsoup-2.4 >= 2.26.1") 2>&5 | |
11281 | 11288 | ac_status=$? |
11282 | 11289 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
11283 | 11290 | test $ac_status = 0; }; then |
11284 | pkg_cv_LIBGSSDP_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.18 \ | |
11285 | gobject-2.0 >= 2.18 \ | |
11286 | libsoup-2.4" 2>/dev/null` | |
11291 | pkg_cv_LIBGSSDP_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.22 \ | |
11292 | gobject-2.0 >= 2.22 \ | |
11293 | gio-2.0 >= 2.22 \ | |
11294 | libsoup-2.4 >= 2.26.1" 2>/dev/null` | |
11287 | 11295 | else |
11288 | 11296 | pkg_failed=yes |
11289 | 11297 | fi |
11301 | 11309 | _pkg_short_errors_supported=no |
11302 | 11310 | fi |
11303 | 11311 | if test $_pkg_short_errors_supported = yes; then |
11304 | LIBGSSDP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.18 \ | |
11305 | gobject-2.0 >= 2.18 \ | |
11306 | libsoup-2.4" 2>&1` | |
11312 | LIBGSSDP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.22 \ | |
11313 | gobject-2.0 >= 2.22 \ | |
11314 | gio-2.0 >= 2.22 \ | |
11315 | libsoup-2.4 >= 2.26.1" 2>&1` | |
11307 | 11316 | else |
11308 | LIBGSSDP_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.18 \ | |
11309 | gobject-2.0 >= 2.18 \ | |
11310 | libsoup-2.4" 2>&1` | |
11317 | LIBGSSDP_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.22 \ | |
11318 | gobject-2.0 >= 2.22 \ | |
11319 | gio-2.0 >= 2.22 \ | |
11320 | libsoup-2.4 >= 2.26.1" 2>&1` | |
11311 | 11321 | fi |
11312 | 11322 | # Put the nasty error message in config.log where it belongs |
11313 | 11323 | echo "$LIBGSSDP_PKG_ERRORS" >&5 |
11314 | 11324 | |
11315 | as_fn_error $? "Package requirements (glib-2.0 >= 2.18 \ | |
11316 | gobject-2.0 >= 2.18 \ | |
11317 | libsoup-2.4) were not met: | |
11325 | as_fn_error $? "Package requirements (glib-2.0 >= 2.22 \ | |
11326 | gobject-2.0 >= 2.22 \ | |
11327 | gio-2.0 >= 2.22 \ | |
11328 | libsoup-2.4 >= 2.26.1) were not met: | |
11318 | 11329 | |
11319 | 11330 | $LIBGSSDP_PKG_ERRORS |
11320 | 11331 | |
11570 | 11581 | fi |
11571 | 11582 | |
11572 | 11583 | |
11584 | ||
11585 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Win32" >&5 | |
11586 | $as_echo_n "checking for Win32... " >&6; } | |
11587 | case "$host" in | |
11588 | *-*-mingw*) | |
11589 | os_win32=yes | |
11590 | ;; | |
11591 | *) | |
11592 | os_win32=no | |
11593 | ;; | |
11594 | esac | |
11595 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $os_win32" >&5 | |
11596 | $as_echo "$os_win32" >&6; } | |
11597 | if test $os_win32 = yes; then | |
11598 | OS_WIN32_TRUE= | |
11599 | OS_WIN32_FALSE='#' | |
11600 | else | |
11601 | OS_WIN32_TRUE='#' | |
11602 | OS_WIN32_FALSE= | |
11603 | fi | |
11573 | 11604 | |
11574 | 11605 | |
11575 | 11606 | |
11926 | 11957 | fi |
11927 | 11958 | if test -z "${HAVE_INTROSPECTION_TRUE}" && test -z "${HAVE_INTROSPECTION_FALSE}"; then |
11928 | 11959 | as_fn_error $? "conditional \"HAVE_INTROSPECTION\" was never defined. |
11960 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
11961 | fi | |
11962 | if test -z "${OS_WIN32_TRUE}" && test -z "${OS_WIN32_FALSE}"; then | |
11963 | as_fn_error $? "conditional \"OS_WIN32\" was never defined. | |
11929 | 11964 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
11930 | 11965 | fi |
11931 | 11966 | if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then |
12356 | 12391 | # report actual input values of CONFIG_FILES etc. instead of their |
12357 | 12392 | # values after options handling. |
12358 | 12393 | ac_log=" |
12359 | This file was extended by gssdp $as_me 0.8.2, which was | |
12394 | This file was extended by gssdp $as_me 0.10.0, which was | |
12360 | 12395 | generated by GNU Autoconf 2.67. Invocation command line was |
12361 | 12396 | |
12362 | 12397 | CONFIG_FILES = $CONFIG_FILES |
12422 | 12457 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
12423 | 12458 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
12424 | 12459 | ac_cs_version="\\ |
12425 | gssdp config.status 0.8.2 | |
12460 | gssdp config.status 0.10.0 | |
12426 | 12461 | configured by $0, generated by GNU Autoconf 2.67, |
12427 | 12462 | with options \\"\$ac_cs_config\\" |
12428 | 12463 |
0 | 0 | AC_PREREQ(2.53) |
1 | AC_INIT(gssdp, 0.8.2, http://www.gupnp.org/) | |
1 | AC_INIT(gssdp, 0.10.0, http://www.gupnp.org/) | |
2 | 2 | AM_INIT_AUTOMAKE() |
3 | 3 | AC_CONFIG_SRCDIR(libgssdp/gssdp-client.c) |
4 | 4 | AM_CONFIG_HEADER(config.h) |
11 | 11 | AC_PROG_LIBTOOL |
12 | 12 | AC_CONFIG_MACRO_DIR([m4]) |
13 | 13 | |
14 | PKG_CHECK_MODULES(LIBGSSDP, glib-2.0 >= 2.18 \ | |
15 | gobject-2.0 >= 2.18 \ | |
16 | libsoup-2.4) | |
14 | PKG_CHECK_MODULES(LIBGSSDP, glib-2.0 >= 2.22 \ | |
15 | gobject-2.0 >= 2.22 \ | |
16 | gio-2.0 >= 2.22 \ | |
17 | libsoup-2.4 >= 2.26.1) | |
17 | 18 | |
18 | 19 | LIBGTK_REQUIRED=2.12.0 |
19 | 20 | |
61 | 62 | fi |
62 | 63 | |
63 | 64 | GOBJECT_INTROSPECTION_CHECK([0.6.4]) |
65 | dnl Check for Win32 | |
66 | AC_MSG_CHECKING([for Win32]) | |
67 | case "$host" in | |
68 | *-*-mingw*) | |
69 | os_win32=yes | |
70 | ;; | |
71 | *) | |
72 | os_win32=no | |
73 | ;; | |
74 | esac | |
75 | AC_MSG_RESULT([$os_win32]) | |
76 | AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes]) | |
64 | 77 | |
65 | 78 | GTK_DOC_CHECK([1.0]) |
66 | 79 |
277 | 277 | # |
278 | 278 | GPATH = $(srcdir) |
279 | 279 | TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) |
280 | SETUP_FILES = \ | |
281 | $(content_files) \ | |
282 | $(DOC_MAIN_SGML_FILE) \ | |
283 | $(DOC_MODULE)-sections.txt \ | |
284 | $(DOC_MODULE)-overrides.txt | |
285 | ||
280 | 286 | |
281 | 287 | # This includes the standard gtk-doc make rules, copied by gtkdocize. |
282 | 288 | |
283 | 289 | # Other files to distribute |
284 | 290 | # e.g. EXTRA_DIST += version.xml.in |
285 | EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \ | |
286 | $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt \ | |
287 | version.xml.in | |
288 | DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ | |
289 | pdf-build.stamp \ | |
290 | $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \ | |
291 | $(srcdir)/pdf.stamp | |
291 | EXTRA_DIST = $(SETUP_FILES) version.xml.in | |
292 | DOC_STAMPS = setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ | |
293 | html-build.stamp pdf-build.stamp \ | |
294 | setup.stamp tmpl.stamp sgml.stamp html.stamp pdf.stamp | |
292 | 295 | |
293 | 296 | SCANOBJ_FILES = \ |
294 | 297 | $(DOC_MODULE).args \ |
509 | 512 | |
510 | 513 | $(REPORT_FILES): sgml-build.stamp |
511 | 514 | |
515 | #### setup #### | |
516 | ||
517 | setup-build.stamp: | |
518 | -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ | |
519 | echo 'gtk-doc: Preparing build'; \ | |
520 | files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ | |
521 | if test "x$$files" != "x" ; then \ | |
522 | for file in $$files ; do \ | |
523 | test -f $(abs_srcdir)/$$file && \ | |
524 | cp -p $(abs_srcdir)/$$file $(abs_builddir)/; \ | |
525 | done \ | |
526 | fi; \ | |
527 | test -f $(abs_srcdir)/tmpl && \ | |
528 | cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ | |
529 | fi | |
530 | @touch setup-build.stamp | |
531 | ||
532 | setup.stamp: setup-build.stamp | |
533 | @true | |
534 | ||
512 | 535 | #### scan #### |
513 | 536 | |
514 | 537 | scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) |
515 | 538 | @echo 'gtk-doc: Scanning header files' |
516 | @-chmod -R u+w $(srcdir) | |
517 | @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ | |
539 | @_source_dir='' ; \ | |
540 | for i in $(DOC_SOURCE_DIR) ; do \ | |
518 | 541 | _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
519 | done ; \ | |
520 | cd $(srcdir) && \ | |
521 | gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) | |
522 | @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ | |
523 | CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ | |
542 | done ; \ | |
543 | gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) | |
544 | @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ | |
545 | CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) ; \ | |
524 | 546 | else \ |
525 | cd $(srcdir) ; \ | |
526 | 547 | for i in $(SCANOBJ_FILES) ; do \ |
527 | 548 | test -f $$i || touch $$i ; \ |
528 | 549 | done \ |
534 | 555 | |
535 | 556 | #### templates #### |
536 | 557 | |
537 | tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt | |
558 | tmpl-build.stamp: setup.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt | |
538 | 559 | @echo 'gtk-doc: Rebuilding template files' |
539 | @-chmod -R u+w $(srcdir) | |
540 | @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) | |
560 | @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) | |
561 | @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ | |
562 | if test -w $(abs_srcdir) ; then \ | |
563 | cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ | |
564 | fi \ | |
565 | fi | |
541 | 566 | @touch tmpl-build.stamp |
542 | 567 | |
543 | 568 | tmpl.stamp: tmpl-build.stamp |
551 | 576 | sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) |
552 | 577 | @echo 'gtk-doc: Building XML' |
553 | 578 | @-chmod -R u+w $(srcdir) |
554 | @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ | |
579 | @_source_dir='' ; \ | |
580 | for i in $(DOC_SOURCE_DIR) ; do \ | |
555 | 581 | _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
556 | done ; \ | |
557 | cd $(srcdir) && \ | |
558 | gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) | |
582 | done ; \ | |
583 | gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) | |
559 | 584 | @touch sgml-build.stamp |
560 | 585 | |
561 | 586 | sgml.stamp: sgml-build.stamp |
565 | 590 | |
566 | 591 | html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) |
567 | 592 | @echo 'gtk-doc: Building HTML' |
568 | @-chmod -R u+w $(srcdir) | |
569 | @rm -rf $(srcdir)/html | |
570 | @mkdir $(srcdir)/html | |
593 | @rm -rf html | |
594 | @mkdir html | |
571 | 595 | @mkhtml_options=""; \ |
572 | 596 | gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ |
573 | 597 | if test "$(?)" = "0"; then \ |
574 | mkhtml_options=--path="$(srcdir)"; \ | |
598 | mkhtml_options=--path="$(abs_srcdir)"; \ | |
575 | 599 | fi; \ |
576 | cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) | |
577 | @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) | |
600 | cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) | |
601 | -@test "x$(HTML_IMAGES)" = "x" || \ | |
602 | for file in $(HTML_IMAGES) ; do \ | |
603 | if test -f $(abs_srcdir)/$$file ; then \ | |
604 | cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ | |
605 | fi; \ | |
606 | if test -f $(abs_builddir)/$$file ; then \ | |
607 | cp $(abs_builddir)/$$file $(abs_builddir)/html; \ | |
608 | fi; \ | |
609 | done; | |
578 | 610 | @echo 'gtk-doc: Fixing cross-references' |
579 | @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) | |
611 | @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) | |
580 | 612 | @touch html-build.stamp |
581 | 613 | |
582 | 614 | #### pdf #### |
583 | 615 | |
584 | 616 | pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) |
585 | 617 | @echo 'gtk-doc: Building PDF' |
586 | @-chmod -R u+w $(srcdir) | |
587 | @rm -rf $(srcdir)/$(DOC_MODULE).pdf | |
618 | @rm -rf $(DOC_MODULE).pdf | |
588 | 619 | @mkpdf_imgdirs=""; \ |
589 | 620 | if test "x$(HTML_IMAGES)" != "x"; then \ |
590 | 621 | for img in $(HTML_IMAGES); do \ |
595 | 626 | fi; \ |
596 | 627 | done; \ |
597 | 628 | fi; \ |
598 | cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) | |
629 | gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) | |
599 | 630 | @touch pdf-build.stamp |
600 | 631 | |
601 | 632 | ############## |
605 | 636 | rm -rf .libs |
606 | 637 | |
607 | 638 | distclean-local: |
608 | cd $(srcdir) && \ | |
609 | rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \ | |
610 | $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt | |
639 | rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ | |
640 | $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt | |
641 | if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ | |
642 | rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ | |
643 | rm -rf tmpl; \ | |
644 | fi | |
611 | 645 | |
612 | 646 | maintainer-clean-local: clean |
613 | cd $(srcdir) && rm -rf xml html | |
647 | rm -rf xml html | |
614 | 648 | |
615 | 649 | install-data-local: |
616 | 650 | @installfiles=`echo $(srcdir)/html/*`; \ |
655 | 689 | dist-hook: dist-check-gtkdoc dist-hook-local |
656 | 690 | mkdir $(distdir)/tmpl |
657 | 691 | mkdir $(distdir)/html |
658 | -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl | |
659 | cp $(srcdir)/html/* $(distdir)/html | |
660 | -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/ | |
661 | -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ | |
662 | -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ | |
692 | -cp $(build)/tmpl/*.sgml $(distdir)/tmpl | |
693 | cp $(builddir)/html/* $(distdir)/html | |
694 | -cp $(builddir)/$(DOC_MODULE).pdf $(distdir)/ | |
695 | -cp $(build)/$(DOC_MODULE).types $(distdir)/ | |
696 | -cp $(build)/$(DOC_MODULE)-sections.txt $(distdir)/ | |
663 | 697 | cd $(distdir) && rm -f $(DISTCLEANFILES) |
664 | 698 | $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html |
665 | 699 |
7 | 7 | gssdp_client_get_server_id |
8 | 8 | gssdp_client_get_interface |
9 | 9 | gssdp_client_get_host_ip |
10 | gssdp_client_set_network | |
11 | gssdp_client_get_network | |
10 | 12 | gssdp_client_get_active |
11 | 13 | <SUBSECTION Standard> |
12 | 14 | GSSDP_CLIENT |
0 | #include <libgssdp/gssdp.h> | |
1 | ||
2 | gssdp_client_get_type | |
3 | gssdp_resource_browser_get_type | |
4 | gssdp_resource_group_get_type |
7 | 7 | <link rel="up" href="ch01.html" title="GSSDP"> |
8 | 8 | <link rel="prev" href="ch01.html" title="GSSDP"> |
9 | 9 | <link rel="next" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"> |
10 | <meta name="generator" content="GTK-Doc V1.15.1 (XML mode)"> | |
10 | <meta name="generator" content="GTK-Doc V1.17.1 (XML mode)"> | |
11 | 11 | <link rel="stylesheet" href="style.css" type="text/css"> |
12 | 12 | </head> |
13 | 13 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
44 | 44 | <a name="GSSDPClient.synopsis"></a><h2>Synopsis</h2> |
45 | 45 | <pre class="synopsis"> <a class="link" href="GSSDPClient.html#GSSDPClient-struct" title="GSSDPClient">GSSDPClient</a>; |
46 | 46 | <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="returnvalue">GSSDPClient</span></a> * <a class="link" href="GSSDPClient.html#gssdp-client-new" title="gssdp_client_new ()">gssdp_client_new</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> *main_context</code></em>, |
47 | <em class="parameter"><code>const <span class="type">char</span> *interface</code></em>, | |
47 | <em class="parameter"><code>const <span class="type">char</span> *iface</code></em>, | |
48 | 48 | <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>); |
49 | 49 | <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="returnvalue">GMainContext</span></a> * <a class="link" href="GSSDPClient.html#gssdp-client-get-main-context" title="gssdp_client_get_main_context ()">gssdp_client_get_main_context</a> (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>); |
50 | 50 | <span class="returnvalue">void</span> <a class="link" href="GSSDPClient.html#gssdp-client-set-server-id" title="gssdp_client_set_server_id ()">gssdp_client_set_server_id</a> (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>, |
52 | 52 | const <span class="returnvalue">char</span> * <a class="link" href="GSSDPClient.html#gssdp-client-get-server-id" title="gssdp_client_get_server_id ()">gssdp_client_get_server_id</a> (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>); |
53 | 53 | const <span class="returnvalue">char</span> * <a class="link" href="GSSDPClient.html#gssdp-client-get-interface" title="gssdp_client_get_interface ()">gssdp_client_get_interface</a> (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>); |
54 | 54 | const <span class="returnvalue">char</span> * <a class="link" href="GSSDPClient.html#gssdp-client-get-host-ip" title="gssdp_client_get_host_ip ()">gssdp_client_get_host_ip</a> (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>); |
55 | <span class="returnvalue">void</span> <a class="link" href="GSSDPClient.html#gssdp-client-set-network" title="gssdp_client_set_network ()">gssdp_client_set_network</a> (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>, | |
56 | <em class="parameter"><code>const <span class="type">char</span> *network</code></em>); | |
57 | const <span class="returnvalue">char</span> * <a class="link" href="GSSDPClient.html#gssdp-client-get-network" title="gssdp_client_get_network ()">gssdp_client_get_network</a> (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>); | |
55 | 58 | <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GSSDPClient.html#gssdp-client-get-active" title="gssdp_client_get_active ()">gssdp_client_get_active</a> (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>); |
56 | 59 | </pre> |
57 | 60 | </div> |
70 | 73 | "<a class="link" href="GSSDPClient.html#GSSDPClient--host-ip" title='The "host-ip" property'>host-ip</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read |
71 | 74 | "<a class="link" href="GSSDPClient.html#GSSDPClient--interface" title='The "interface" property'>interface</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only |
72 | 75 | "<a class="link" href="GSSDPClient.html#GSSDPClient--main-context" title='The "main-context" property'>main-context</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> : Read / Write / Construct Only |
76 | "<a class="link" href="GSSDPClient.html#GSSDPClient--network" title='The "network" property'>network</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct | |
73 | 77 | "<a class="link" href="GSSDPClient.html#GSSDPClient--server-id" title='The "server-id" property'>server-id</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write |
74 | 78 | </pre> |
75 | 79 | </div> |
85 | 89 | <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> wraps the SSDP "bus" as used by both <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> |
86 | 90 | and <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a>. |
87 | 91 | </p> |
88 | <p> | |
89 | </p> | |
90 | 92 | </div> |
91 | 93 | <div class="refsect1"> |
92 | 94 | <a name="GSSDPClient.details"></a><h2>Details</h2> |
100 | 102 | <div class="refsect2"> |
101 | 103 | <a name="gssdp-client-new"></a><h3>gssdp_client_new ()</h3> |
102 | 104 | <pre class="programlisting"><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="returnvalue">GSSDPClient</span></a> * gssdp_client_new (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> *main_context</code></em>, |
103 | <em class="parameter"><code>const <span class="type">char</span> *interface</code></em>, | |
105 | <em class="parameter"><code>const <span class="type">char</span> *iface</code></em>, | |
104 | 106 | <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> |
105 | <p> | |
106 | </p> | |
107 | 107 | <div class="variablelist"><table border="0"> |
108 | 108 | <col align="left" valign="top"> |
109 | 109 | <tbody> |
110 | 110 | <tr> |
111 | 111 | <td><p><span class="term"><em class="parameter"><code>main_context</code></em> :</span></p></td> |
112 | <td>The <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> to associate with, or NULL | |
113 | </td> | |
114 | </tr> | |
115 | <tr> | |
116 | <td><p><span class="term"><em class="parameter"><code>interface</code></em> :</span></p></td> | |
117 | <td>The name of the network interface, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for auto-detection. | |
118 | </td> | |
112 | <td>The <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> to associate with, or NULL</td> | |
119 | 113 | </tr> |
120 | 114 | <tr> |
121 | 115 | <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> |
122 | <td>Location to store error, or NULL | |
123 | </td> | |
124 | </tr> | |
125 | <tr> | |
126 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
127 | <td> A new <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> object. | |
128 | </td> | |
116 | <td>Location to store error, or NULL</td> | |
117 | </tr> | |
118 | <tr> | |
119 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
120 | <td>A new <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> object.</td> | |
129 | 121 | </tr> |
130 | 122 | </tbody> |
131 | 123 | </table></div> |
134 | 126 | <div class="refsect2"> |
135 | 127 | <a name="gssdp-client-get-main-context"></a><h3>gssdp_client_get_main_context ()</h3> |
136 | 128 | <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="returnvalue">GMainContext</span></a> * gssdp_client_get_main_context (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>);</pre> |
137 | <p> | |
138 | </p> | |
139 | <div class="variablelist"><table border="0"> | |
140 | <col align="left" valign="top"> | |
141 | <tbody> | |
142 | <tr> | |
143 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
144 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
145 | </td> | |
146 | </tr> | |
147 | <tr> | |
148 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
149 | <td> The <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> <em class="parameter"><code>client</code></em> is associated with, or NULL. | |
150 | </td> | |
129 | <div class="variablelist"><table border="0"> | |
130 | <col align="left" valign="top"> | |
131 | <tbody> | |
132 | <tr> | |
133 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
134 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
135 | </td> | |
136 | </tr> | |
137 | <tr> | |
138 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
139 | <td>The <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> <em class="parameter"><code>client</code></em> is associated with, or NULL.</td> | |
151 | 140 | </tr> |
152 | 141 | </tbody> |
153 | 142 | </table></div> |
160 | 149 | <p> |
161 | 150 | Sets the server ID of <em class="parameter"><code>client</code></em> to <em class="parameter"><code>server_id</code></em>. |
162 | 151 | </p> |
163 | <p> | |
164 | </p> | |
165 | 152 | <div class="variablelist"><table border="0"> |
166 | 153 | <col align="left" valign="top"> |
167 | 154 | <tbody> |
172 | 159 | </tr> |
173 | 160 | <tr> |
174 | 161 | <td><p><span class="term"><em class="parameter"><code>server_id</code></em> :</span></p></td> |
175 | <td>The server ID | |
176 | </td> | |
162 | <td>The server ID</td> | |
177 | 163 | </tr> |
178 | 164 | </tbody> |
179 | 165 | </table></div> |
182 | 168 | <div class="refsect2"> |
183 | 169 | <a name="gssdp-client-get-server-id"></a><h3>gssdp_client_get_server_id ()</h3> |
184 | 170 | <pre class="programlisting">const <span class="returnvalue">char</span> * gssdp_client_get_server_id (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>);</pre> |
185 | <p> | |
186 | </p> | |
187 | <div class="variablelist"><table border="0"> | |
188 | <col align="left" valign="top"> | |
189 | <tbody> | |
190 | <tr> | |
191 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
192 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
193 | </td> | |
194 | </tr> | |
195 | <tr> | |
196 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
197 | <td> The server ID. | |
198 | </td> | |
171 | <div class="variablelist"><table border="0"> | |
172 | <col align="left" valign="top"> | |
173 | <tbody> | |
174 | <tr> | |
175 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
176 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
177 | </td> | |
178 | </tr> | |
179 | <tr> | |
180 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
181 | <td>The server ID.</td> | |
199 | 182 | </tr> |
200 | 183 | </tbody> |
201 | 184 | </table></div> |
207 | 190 | <p> |
208 | 191 | Get the name of the network interface associated to <em class="parameter"><code>client</code></em>. |
209 | 192 | </p> |
210 | <p> | |
211 | </p> | |
212 | <div class="variablelist"><table border="0"> | |
213 | <col align="left" valign="top"> | |
214 | <tbody> | |
215 | <tr> | |
216 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
217 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
218 | </td> | |
219 | </tr> | |
220 | <tr> | |
221 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
222 | <td> The network interface name. This string should not be freed. | |
223 | </td> | |
193 | <div class="variablelist"><table border="0"> | |
194 | <col align="left" valign="top"> | |
195 | <tbody> | |
196 | <tr> | |
197 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
198 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
199 | </td> | |
200 | </tr> | |
201 | <tr> | |
202 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
203 | <td>The network interface name. This string should not be freed.</td> | |
224 | 204 | </tr> |
225 | 205 | </tbody> |
226 | 206 | </table></div> |
232 | 212 | <p> |
233 | 213 | Get the IP address we advertise ourselves as using. |
234 | 214 | </p> |
235 | <p> | |
236 | </p> | |
237 | <div class="variablelist"><table border="0"> | |
238 | <col align="left" valign="top"> | |
239 | <tbody> | |
240 | <tr> | |
241 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
242 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
243 | </td> | |
244 | </tr> | |
245 | <tr> | |
246 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
247 | <td> The IP address. This string should not be freed. | |
248 | </td> | |
215 | <div class="variablelist"><table border="0"> | |
216 | <col align="left" valign="top"> | |
217 | <tbody> | |
218 | <tr> | |
219 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
220 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
221 | </td> | |
222 | </tr> | |
223 | <tr> | |
224 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
225 | <td>The IP address. This string should not be freed.</td> | |
226 | </tr> | |
227 | </tbody> | |
228 | </table></div> | |
229 | </div> | |
230 | <hr> | |
231 | <div class="refsect2"> | |
232 | <a name="gssdp-client-set-network"></a><h3>gssdp_client_set_network ()</h3> | |
233 | <pre class="programlisting"><span class="returnvalue">void</span> gssdp_client_set_network (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>, | |
234 | <em class="parameter"><code>const <span class="type">char</span> *network</code></em>);</pre> | |
235 | <p> | |
236 | Sets the network identification of <em class="parameter"><code>client</code></em> to <em class="parameter"><code>network</code></em>. | |
237 | </p> | |
238 | <div class="variablelist"><table border="0"> | |
239 | <col align="left" valign="top"> | |
240 | <tbody> | |
241 | <tr> | |
242 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
243 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
244 | </td> | |
245 | </tr> | |
246 | <tr> | |
247 | <td><p><span class="term"><em class="parameter"><code>network</code></em> :</span></p></td> | |
248 | <td>The string identifying the network</td> | |
249 | </tr> | |
250 | </tbody> | |
251 | </table></div> | |
252 | </div> | |
253 | <hr> | |
254 | <div class="refsect2"> | |
255 | <a name="gssdp-client-get-network"></a><h3>gssdp_client_get_network ()</h3> | |
256 | <pre class="programlisting">const <span class="returnvalue">char</span> * gssdp_client_get_network (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>);</pre> | |
257 | <p> | |
258 | Get the network this client is associated with. | |
259 | </p> | |
260 | <div class="variablelist"><table border="0"> | |
261 | <col align="left" valign="top"> | |
262 | <tbody> | |
263 | <tr> | |
264 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
265 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
266 | </td> | |
267 | </tr> | |
268 | <tr> | |
269 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
270 | <td>The network identification. This string should not be freed.</td> | |
249 | 271 | </tr> |
250 | 272 | </tbody> |
251 | 273 | </table></div> |
254 | 276 | <div class="refsect2"> |
255 | 277 | <a name="gssdp-client-get-active"></a><h3>gssdp_client_get_active ()</h3> |
256 | 278 | <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gssdp_client_get_active (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>);</pre> |
257 | <p> | |
258 | </p> | |
259 | <div class="variablelist"><table border="0"> | |
260 | <col align="left" valign="top"> | |
261 | <tbody> | |
262 | <tr> | |
263 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
264 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
265 | </td> | |
266 | </tr> | |
267 | <tr> | |
268 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
269 | <td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>client</code></em> is active, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise. | |
270 | </td> | |
279 | <div class="variablelist"><table border="0"> | |
280 | <col align="left" valign="top"> | |
281 | <tbody> | |
282 | <tr> | |
283 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> | |
284 | <td>A <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> | |
285 | </td> | |
286 | </tr> | |
287 | <tr> | |
288 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
289 | <td> | |
290 | <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>client</code></em> is active, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td> | |
271 | 291 | </tr> |
272 | 292 | </tbody> |
273 | 293 | </table></div> |
283 | 303 | (default), the client sends messages on the network, otherwise |
284 | 304 | not. In most cases, you don't want to touch this property. |
285 | 305 | </p> |
286 | <p> | |
287 | </p> | |
288 | 306 | <p>Default value: TRUE</p> |
289 | 307 | </div> |
290 | 308 | <hr> |
294 | 312 | <p> |
295 | 313 | Internal property. |
296 | 314 | </p> |
297 | <p> | |
298 | </p> | |
299 | 315 | <p class="stability">Stability Level: Private</p> |
300 | 316 | </div> |
301 | 317 | <hr> |
305 | 321 | <p> |
306 | 322 | The IP address of the assoicated network interface. |
307 | 323 | </p> |
308 | <p> | |
309 | </p> | |
310 | 324 | <p>Default value: NULL</p> |
311 | 325 | </div> |
312 | 326 | <hr> |
317 | 331 | The name of the network interface this client is associated with. |
318 | 332 | Set to NULL to autodetect. |
319 | 333 | </p> |
320 | <p> | |
321 | </p> | |
322 | 334 | <p>Default value: NULL</p> |
323 | 335 | </div> |
324 | 336 | <hr> |
328 | 340 | <p> |
329 | 341 | The <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> to use. Set to NULL to use the default. |
330 | 342 | </p> |
331 | <p> | |
332 | </p> | |
343 | </div> | |
344 | <hr> | |
345 | <div class="refsect2"> | |
346 | <a name="GSSDPClient--network"></a><h3>The <code class="literal">"network"</code> property</h3> | |
347 | <pre class="programlisting"> "network" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct</pre> | |
348 | <p> | |
349 | The network this client is currently connected to. You could set this | |
350 | to anything you want to identify the network this client is | |
351 | associated with. If you are using <a href="/opt/gnome2/share/gtk-doc/html/gupnp/GUPnPContextManager.html"><span class="type">GUPnPContextManager</span></a> and associated | |
352 | interface is a WiFi interface, this property is set to the ESSID of | |
353 | the network. Otherwise, expect this to be the network IP address by | |
354 | default. | |
355 | </p> | |
356 | <p>Default value: NULL</p> | |
333 | 357 | </div> |
334 | 358 | <hr> |
335 | 359 | <div class="refsect2"> |
337 | 361 | <pre class="programlisting"> "server-id" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write</pre> |
338 | 362 | <p> |
339 | 363 | The SSDP server's identifier. |
340 | </p> | |
341 | <p> | |
342 | 364 | </p> |
343 | 365 | <p>Default value: NULL</p> |
344 | 366 | </div> |
356 | 378 | <p> |
357 | 379 | Internal signal. |
358 | 380 | </p> |
359 | <p> | |
360 | </p> | |
361 | 381 | <div class="variablelist"><table border="0"> |
362 | 382 | <col align="left" valign="top"> |
363 | 383 | <tbody><tr> |
371 | 391 | </div> |
372 | 392 | <div class="footer"> |
373 | 393 | <hr> |
374 | Generated by GTK-Doc V1.15.1</div> | |
394 | Generated by GTK-Doc V1.17.1</div> | |
375 | 395 | </body> |
376 | 396 | </html>⏎ |
7 | 7 | <link rel="up" href="ch01.html" title="GSSDP"> |
8 | 8 | <link rel="prev" href="GSSDPClient.html" title="GSSDPClient"> |
9 | 9 | <link rel="next" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"> |
10 | <meta name="generator" content="GTK-Doc V1.15.1 (XML mode)"> | |
10 | <meta name="generator" content="GTK-Doc V1.17.1 (XML mode)"> | |
11 | 11 | <link rel="stylesheet" href="style.css" type="text/css"> |
12 | 12 | </head> |
13 | 13 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
90 | 90 | specified discovery target changes. A discovery request is sent out |
91 | 91 | automatically when activating the browser. |
92 | 92 | </p> |
93 | <p> | |
94 | </p> | |
95 | 93 | </div> |
96 | 94 | <div class="refsect1"> |
97 | 95 | <a name="GSSDPResourceBrowser.details"></a><h2>Details</h2> |
108 | 106 | </pre> |
109 | 107 | <p> |
110 | 108 | SSDP search target for finding all possible resources. |
111 | </p> | |
112 | <p> | |
113 | 109 | </p> |
114 | 110 | </div> |
115 | 111 | <hr> |
117 | 113 | <a name="gssdp-resource-browser-new"></a><h3>gssdp_resource_browser_new ()</h3> |
118 | 114 | <pre class="programlisting"><a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="returnvalue">GSSDPResourceBrowser</span></a> * gssdp_resource_browser_new (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>, |
119 | 115 | <em class="parameter"><code>const <span class="type">char</span> *target</code></em>);</pre> |
120 | <p> | |
121 | </p> | |
122 | 116 | <div class="variablelist"><table border="0"> |
123 | 117 | <col align="left" valign="top"> |
124 | 118 | <tbody> |
125 | 119 | <tr> |
126 | 120 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> |
127 | <td>The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> to associate with | |
128 | </td> | |
129 | </tr> | |
130 | <tr> | |
131 | <td><p><span class="term"><em class="parameter"><code>target</code></em> :</span></p></td> | |
132 | <td> | |
133 | </td> | |
134 | </tr> | |
135 | <tr> | |
136 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
137 | <td> A new <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> object. | |
138 | </td> | |
121 | <td>The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> to associate with</td> | |
122 | </tr> | |
123 | <tr> | |
124 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
125 | <td>A new <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> object.</td> | |
139 | 126 | </tr> |
140 | 127 | </tbody> |
141 | 128 | </table></div> |
144 | 131 | <div class="refsect2"> |
145 | 132 | <a name="gssdp-resource-browser-get-client"></a><h3>gssdp_resource_browser_get_client ()</h3> |
146 | 133 | <pre class="programlisting"><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="returnvalue">GSSDPClient</span></a> * gssdp_resource_browser_get_client (<em class="parameter"><code><a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> *resource_browser</code></em>);</pre> |
147 | <p> | |
148 | </p> | |
149 | <div class="variablelist"><table border="0"> | |
150 | <col align="left" valign="top"> | |
151 | <tbody> | |
152 | <tr> | |
153 | <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td> | |
154 | <td>A <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> | |
155 | </td> | |
156 | </tr> | |
157 | <tr> | |
158 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
159 | <td> The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> <em class="parameter"><code>resource_browser</code></em> is associated with. | |
160 | </td> | |
134 | <div class="variablelist"><table border="0"> | |
135 | <col align="left" valign="top"> | |
136 | <tbody> | |
137 | <tr> | |
138 | <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td> | |
139 | <td>A <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> | |
140 | </td> | |
141 | </tr> | |
142 | <tr> | |
143 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
144 | <td>The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> <em class="parameter"><code>resource_browser</code></em> is associated with.</td> | |
161 | 145 | </tr> |
162 | 146 | </tbody> |
163 | 147 | </table></div> |
170 | 154 | <p> |
171 | 155 | Sets the browser target of <em class="parameter"><code>resource_browser</code></em> to <em class="parameter"><code>target</code></em>. |
172 | 156 | </p> |
173 | <p> | |
174 | </p> | |
175 | 157 | <div class="variablelist"><table border="0"> |
176 | 158 | <col align="left" valign="top"> |
177 | 159 | <tbody> |
182 | 164 | </tr> |
183 | 165 | <tr> |
184 | 166 | <td><p><span class="term"><em class="parameter"><code>target</code></em> :</span></p></td> |
185 | <td>The browser target | |
186 | </td> | |
167 | <td>The browser target</td> | |
187 | 168 | </tr> |
188 | 169 | </tbody> |
189 | 170 | </table></div> |
192 | 173 | <div class="refsect2"> |
193 | 174 | <a name="gssdp-resource-browser-get-target"></a><h3>gssdp_resource_browser_get_target ()</h3> |
194 | 175 | <pre class="programlisting">const <span class="returnvalue">char</span> * gssdp_resource_browser_get_target (<em class="parameter"><code><a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> *resource_browser</code></em>);</pre> |
195 | <p> | |
196 | </p> | |
197 | <div class="variablelist"><table border="0"> | |
198 | <col align="left" valign="top"> | |
199 | <tbody> | |
200 | <tr> | |
201 | <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td> | |
202 | <td>A <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> | |
203 | </td> | |
204 | </tr> | |
205 | <tr> | |
206 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
207 | <td> The browser target. | |
208 | </td> | |
176 | <div class="variablelist"><table border="0"> | |
177 | <col align="left" valign="top"> | |
178 | <tbody> | |
179 | <tr> | |
180 | <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td> | |
181 | <td>A <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> | |
182 | </td> | |
183 | </tr> | |
184 | <tr> | |
185 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
186 | <td>The browser target.</td> | |
209 | 187 | </tr> |
210 | 188 | </tbody> |
211 | 189 | </table></div> |
218 | 196 | <p> |
219 | 197 | Sets the used MX value of <em class="parameter"><code>resource_browser</code></em> to <em class="parameter"><code>mx</code></em>. |
220 | 198 | </p> |
221 | <p> | |
222 | </p> | |
223 | 199 | <div class="variablelist"><table border="0"> |
224 | 200 | <col align="left" valign="top"> |
225 | 201 | <tbody> |
230 | 206 | </tr> |
231 | 207 | <tr> |
232 | 208 | <td><p><span class="term"><em class="parameter"><code>mx</code></em> :</span></p></td> |
233 | <td>The to be used MX value | |
234 | </td> | |
209 | <td>The to be used MX value</td> | |
235 | 210 | </tr> |
236 | 211 | </tbody> |
237 | 212 | </table></div> |
240 | 215 | <div class="refsect2"> |
241 | 216 | <a name="gssdp-resource-browser-get-mx"></a><h3>gssdp_resource_browser_get_mx ()</h3> |
242 | 217 | <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gushort"><span class="returnvalue">gushort</span></a> gssdp_resource_browser_get_mx (<em class="parameter"><code><a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> *resource_browser</code></em>);</pre> |
243 | <p> | |
244 | </p> | |
245 | <div class="variablelist"><table border="0"> | |
246 | <col align="left" valign="top"> | |
247 | <tbody> | |
248 | <tr> | |
249 | <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td> | |
250 | <td>A <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> | |
251 | </td> | |
252 | </tr> | |
253 | <tr> | |
254 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
255 | <td> The used MX value. | |
256 | </td> | |
218 | <div class="variablelist"><table border="0"> | |
219 | <col align="left" valign="top"> | |
220 | <tbody> | |
221 | <tr> | |
222 | <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td> | |
223 | <td>A <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> | |
224 | </td> | |
225 | </tr> | |
226 | <tr> | |
227 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
228 | <td>The used MX value.</td> | |
257 | 229 | </tr> |
258 | 230 | </tbody> |
259 | 231 | </table></div> |
266 | 238 | <p> |
267 | 239 | (De)activates <em class="parameter"><code>resource_browser</code></em>. |
268 | 240 | </p> |
269 | <p> | |
270 | </p> | |
271 | 241 | <div class="variablelist"><table border="0"> |
272 | 242 | <col align="left" valign="top"> |
273 | 243 | <tbody> |
288 | 258 | <div class="refsect2"> |
289 | 259 | <a name="gssdp-resource-browser-get-active"></a><h3>gssdp_resource_browser_get_active ()</h3> |
290 | 260 | <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gssdp_resource_browser_get_active (<em class="parameter"><code><a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> *resource_browser</code></em>);</pre> |
291 | <p> | |
292 | </p> | |
293 | <div class="variablelist"><table border="0"> | |
294 | <col align="left" valign="top"> | |
295 | <tbody> | |
296 | <tr> | |
297 | <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td> | |
298 | <td>A <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> | |
299 | </td> | |
300 | </tr> | |
301 | <tr> | |
302 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
303 | <td> TRUE if <em class="parameter"><code>resource_browser</code></em> is active. | |
304 | </td> | |
261 | <div class="variablelist"><table border="0"> | |
262 | <col align="left" valign="top"> | |
263 | <tbody> | |
264 | <tr> | |
265 | <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td> | |
266 | <td>A <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> | |
267 | </td> | |
268 | </tr> | |
269 | <tr> | |
270 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
271 | <td>TRUE if <em class="parameter"><code>resource_browser</code></em> is active.</td> | |
305 | 272 | </tr> |
306 | 273 | </tbody> |
307 | 274 | </table></div> |
315 | 282 | <p> |
316 | 283 | Whether this browser is active or not. |
317 | 284 | </p> |
318 | <p> | |
319 | </p> | |
320 | 285 | <p>Default value: FALSE</p> |
321 | 286 | </div> |
322 | 287 | <hr> |
326 | 291 | <p> |
327 | 292 | The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> to use. |
328 | 293 | </p> |
329 | <p> | |
330 | </p> | |
331 | 294 | </div> |
332 | 295 | <hr> |
333 | 296 | <div class="refsect2"> |
337 | 300 | The maximum number of seconds in which to request other parties |
338 | 301 | to respond. |
339 | 302 | </p> |
340 | <p> | |
341 | </p> | |
342 | 303 | <p>Allowed values: [1,65535]</p> |
343 | 304 | <p>Default value: 3</p> |
344 | 305 | </div> |
348 | 309 | <pre class="programlisting"> "target" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write</pre> |
349 | 310 | <p> |
350 | 311 | The discovery target. |
351 | </p> | |
352 | <p> | |
353 | 312 | </p> |
354 | 313 | <p>Default value: NULL</p> |
355 | 314 | </div> |
366 | 325 | The ::resource-available signal is emitted whenever a new resource |
367 | 326 | has become available. |
368 | 327 | </p> |
369 | <p> | |
370 | </p> | |
371 | 328 | <div class="variablelist"><table border="0"> |
372 | 329 | <col align="left" valign="top"> |
373 | 330 | <tbody> |
374 | 331 | <tr> |
375 | 332 | <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td> |
376 | 333 | <td>The <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> that received the |
377 | signal | |
378 | </td> | |
334 | signal</td> | |
379 | 335 | </tr> |
380 | 336 | <tr> |
381 | 337 | <td><p><span class="term"><em class="parameter"><code>usn</code></em> :</span></p></td> |
382 | <td>The USN of the discovered resource | |
383 | </td> | |
338 | <td>The USN of the discovered resource</td> | |
384 | 339 | </tr> |
385 | 340 | <tr> |
386 | 341 | <td><p><span class="term"><em class="parameter"><code>locations</code></em> :</span></p></td> |
387 | 342 | <td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> of strings describing the locations of the |
388 | discovered resource. | |
389 | </td> | |
343 | discovered resource.</td> | |
390 | 344 | </tr> |
391 | 345 | <tr> |
392 | 346 | <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> |
405 | 359 | The ::resource-unavailable signal is emitted whenever a resource |
406 | 360 | is not available any more. |
407 | 361 | </p> |
408 | <p> | |
409 | </p> | |
410 | 362 | <div class="variablelist"><table border="0"> |
411 | 363 | <col align="left" valign="top"> |
412 | 364 | <tbody> |
413 | 365 | <tr> |
414 | 366 | <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td> |
415 | 367 | <td>The <a class="link" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"><span class="type">GSSDPResourceBrowser</span></a> that received the |
416 | signal | |
417 | </td> | |
368 | signal</td> | |
418 | 369 | </tr> |
419 | 370 | <tr> |
420 | 371 | <td><p><span class="term"><em class="parameter"><code>usn</code></em> :</span></p></td> |
421 | <td>The USN of the resource | |
422 | </td> | |
372 | <td>The USN of the resource</td> | |
423 | 373 | </tr> |
424 | 374 | <tr> |
425 | 375 | <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> |
432 | 382 | </div> |
433 | 383 | <div class="footer"> |
434 | 384 | <hr> |
435 | Generated by GTK-Doc V1.15.1</div> | |
385 | Generated by GTK-Doc V1.17.1</div> | |
436 | 386 | </body> |
437 | 387 | </html>⏎ |
7 | 7 | <link rel="up" href="ch01.html" title="GSSDP"> |
8 | 8 | <link rel="prev" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser"> |
9 | 9 | <link rel="next" href="gssdp-Error-codes.html" title="Error codes"> |
10 | <meta name="generator" content="GTK-Doc V1.15.1 (XML mode)"> | |
10 | <meta name="generator" content="GTK-Doc V1.17.1 (XML mode)"> | |
11 | 11 | <link rel="stylesheet" href="style.css" type="text/css"> |
12 | 12 | </head> |
13 | 13 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
91 | 91 | be controlled as one. This is useful when one needs to announce a single |
92 | 92 | service as multiple SSDP resources (UPnP does this for example). |
93 | 93 | </p> |
94 | <p> | |
95 | </p> | |
96 | 94 | </div> |
97 | 95 | <div class="refsect1"> |
98 | 96 | <a name="GSSDPResourceGroup.details"></a><h2>Details</h2> |
106 | 104 | <div class="refsect2"> |
107 | 105 | <a name="gssdp-resource-group-new"></a><h3>gssdp_resource_group_new ()</h3> |
108 | 106 | <pre class="programlisting"><a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="returnvalue">GSSDPResourceGroup</span></a> * gssdp_resource_group_new (<em class="parameter"><code><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> *client</code></em>);</pre> |
109 | <p> | |
110 | </p> | |
111 | 107 | <div class="variablelist"><table border="0"> |
112 | 108 | <col align="left" valign="top"> |
113 | 109 | <tbody> |
114 | 110 | <tr> |
115 | 111 | <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td> |
116 | <td>The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> to associate with | |
117 | </td> | |
118 | </tr> | |
119 | <tr> | |
120 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
121 | <td> A new <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> object. | |
122 | </td> | |
112 | <td>The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> to associate with</td> | |
113 | </tr> | |
114 | <tr> | |
115 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
116 | <td>A new <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> object.</td> | |
123 | 117 | </tr> |
124 | 118 | </tbody> |
125 | 119 | </table></div> |
128 | 122 | <div class="refsect2"> |
129 | 123 | <a name="gssdp-resource-group-get-client"></a><h3>gssdp_resource_group_get_client ()</h3> |
130 | 124 | <pre class="programlisting"><a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="returnvalue">GSSDPClient</span></a> * gssdp_resource_group_get_client (<em class="parameter"><code><a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> *resource_group</code></em>);</pre> |
131 | <p> | |
132 | </p> | |
133 | <div class="variablelist"><table border="0"> | |
134 | <col align="left" valign="top"> | |
135 | <tbody> | |
136 | <tr> | |
137 | <td><p><span class="term"><em class="parameter"><code>resource_group</code></em> :</span></p></td> | |
138 | <td>A <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> | |
139 | </td> | |
140 | </tr> | |
141 | <tr> | |
142 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
143 | <td> The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> <em class="parameter"><code>resource_group</code></em> is associated with. | |
144 | </td> | |
125 | <div class="variablelist"><table border="0"> | |
126 | <col align="left" valign="top"> | |
127 | <tbody> | |
128 | <tr> | |
129 | <td><p><span class="term"><em class="parameter"><code>resource_group</code></em> :</span></p></td> | |
130 | <td>A <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> | |
131 | </td> | |
132 | </tr> | |
133 | <tr> | |
134 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
135 | <td>The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> <em class="parameter"><code>resource_group</code></em> is associated with.</td> | |
145 | 136 | </tr> |
146 | 137 | </tbody> |
147 | 138 | </table></div> |
154 | 145 | <p> |
155 | 146 | Sets the number of seconds advertisements are valid to <em class="parameter"><code>max_age</code></em>. |
156 | 147 | </p> |
157 | <p> | |
158 | </p> | |
159 | 148 | <div class="variablelist"><table border="0"> |
160 | 149 | <col align="left" valign="top"> |
161 | 150 | <tbody> |
166 | 155 | </tr> |
167 | 156 | <tr> |
168 | 157 | <td><p><span class="term"><em class="parameter"><code>max_age</code></em> :</span></p></td> |
169 | <td>The number of seconds advertisements are valid | |
170 | </td> | |
158 | <td>The number of seconds advertisements are valid</td> | |
171 | 159 | </tr> |
172 | 160 | </tbody> |
173 | 161 | </table></div> |
176 | 164 | <div class="refsect2"> |
177 | 165 | <a name="gssdp-resource-group-get-max-age"></a><h3>gssdp_resource_group_get_max_age ()</h3> |
178 | 166 | <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gssdp_resource_group_get_max_age (<em class="parameter"><code><a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> *resource_group</code></em>);</pre> |
179 | <p> | |
180 | </p> | |
181 | <div class="variablelist"><table border="0"> | |
182 | <col align="left" valign="top"> | |
183 | <tbody> | |
184 | <tr> | |
185 | <td><p><span class="term"><em class="parameter"><code>resource_group</code></em> :</span></p></td> | |
186 | <td>A <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> | |
187 | </td> | |
188 | </tr> | |
189 | <tr> | |
190 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
191 | <td> The number of seconds advertisements are valid. | |
192 | </td> | |
167 | <div class="variablelist"><table border="0"> | |
168 | <col align="left" valign="top"> | |
169 | <tbody> | |
170 | <tr> | |
171 | <td><p><span class="term"><em class="parameter"><code>resource_group</code></em> :</span></p></td> | |
172 | <td>A <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> | |
173 | </td> | |
174 | </tr> | |
175 | <tr> | |
176 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
177 | <td>The number of seconds advertisements are valid.</td> | |
193 | 178 | </tr> |
194 | 179 | </tbody> |
195 | 180 | </table></div> |
204 | 189 | <em class="parameter"><code>resource_group</code></em>s availability causes it to announce its new state |
205 | 190 | to listening SSDP clients. |
206 | 191 | </p> |
207 | <p> | |
208 | </p> | |
209 | 192 | <div class="variablelist"><table border="0"> |
210 | 193 | <col align="left" valign="top"> |
211 | 194 | <tbody> |
216 | 199 | </tr> |
217 | 200 | <tr> |
218 | 201 | <td><p><span class="term"><em class="parameter"><code>available</code></em> :</span></p></td> |
219 | <td>TRUE if <em class="parameter"><code>resource_group</code></em> should be available (advertised) | |
220 | </td> | |
202 | <td>TRUE if <em class="parameter"><code>resource_group</code></em> should be available (advertised)</td> | |
221 | 203 | </tr> |
222 | 204 | </tbody> |
223 | 205 | </table></div> |
226 | 208 | <div class="refsect2"> |
227 | 209 | <a name="gssdp-resource-group-get-available"></a><h3>gssdp_resource_group_get_available ()</h3> |
228 | 210 | <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gssdp_resource_group_get_available (<em class="parameter"><code><a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> *resource_group</code></em>);</pre> |
229 | <p> | |
230 | </p> | |
231 | <div class="variablelist"><table border="0"> | |
232 | <col align="left" valign="top"> | |
233 | <tbody> | |
234 | <tr> | |
235 | <td><p><span class="term"><em class="parameter"><code>resource_group</code></em> :</span></p></td> | |
236 | <td>A <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> | |
237 | </td> | |
238 | </tr> | |
239 | <tr> | |
240 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
241 | <td> TRUE if <em class="parameter"><code>resource_group</code></em> is available (advertised). | |
242 | </td> | |
211 | <div class="variablelist"><table border="0"> | |
212 | <col align="left" valign="top"> | |
213 | <tbody> | |
214 | <tr> | |
215 | <td><p><span class="term"><em class="parameter"><code>resource_group</code></em> :</span></p></td> | |
216 | <td>A <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> | |
217 | </td> | |
218 | </tr> | |
219 | <tr> | |
220 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
221 | <td>TRUE if <em class="parameter"><code>resource_group</code></em> is available (advertised).</td> | |
243 | 222 | </tr> |
244 | 223 | </tbody> |
245 | 224 | </table></div> |
253 | 232 | <p> |
254 | 233 | Sets the minimum time between each SSDP message. |
255 | 234 | </p> |
256 | <p> | |
257 | </p> | |
258 | 235 | <div class="variablelist"><table border="0"> |
259 | 236 | <col align="left" valign="top"> |
260 | 237 | <tbody> |
265 | 242 | </tr> |
266 | 243 | <tr> |
267 | 244 | <td><p><span class="term"><em class="parameter"><code>message_delay</code></em> :</span></p></td> |
268 | <td>The message delay in ms. | |
269 | </td> | |
245 | <td>The message delay in ms.</td> | |
270 | 246 | </tr> |
271 | 247 | </tbody> |
272 | 248 | </table></div> |
276 | 252 | <a name="gssdp-resource-group-get-message-delay"></a><h3>gssdp_resource_group_get_message_delay ()</h3> |
277 | 253 | <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gssdp_resource_group_get_message_delay |
278 | 254 | (<em class="parameter"><code><a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> *resource_group</code></em>);</pre> |
279 | <p> | |
280 | </p> | |
281 | <div class="variablelist"><table border="0"> | |
282 | <col align="left" valign="top"> | |
283 | <tbody> | |
284 | <tr> | |
285 | <td><p><span class="term"><em class="parameter"><code>resource_group</code></em> :</span></p></td> | |
286 | <td>A <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> | |
287 | </td> | |
288 | </tr> | |
289 | <tr> | |
290 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
291 | <td> the minimum time between each SSDP message in ms. | |
292 | </td> | |
255 | <div class="variablelist"><table border="0"> | |
256 | <col align="left" valign="top"> | |
257 | <tbody> | |
258 | <tr> | |
259 | <td><p><span class="term"><em class="parameter"><code>resource_group</code></em> :</span></p></td> | |
260 | <td>A <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a> | |
261 | </td> | |
262 | </tr> | |
263 | <tr> | |
264 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
265 | <td>the minimum time between each SSDP message in ms.</td> | |
293 | 266 | </tr> |
294 | 267 | </tbody> |
295 | 268 | </table></div> |
305 | 278 | Adds a resource with target <em class="parameter"><code>target</code></em>, USN <em class="parameter"><code>usn</code></em>, and locations <em class="parameter"><code>locations</code></em> |
306 | 279 | to <em class="parameter"><code>resource_group</code></em>. |
307 | 280 | </p> |
308 | <p> | |
309 | </p> | |
310 | 281 | <div class="variablelist"><table border="0"> |
311 | 282 | <col align="left" valign="top"> |
312 | 283 | <tbody> |
317 | 288 | </tr> |
318 | 289 | <tr> |
319 | 290 | <td><p><span class="term"><em class="parameter"><code>target</code></em> :</span></p></td> |
320 | <td>The resource's target | |
321 | </td> | |
291 | <td>The resource's target</td> | |
322 | 292 | </tr> |
323 | 293 | <tr> |
324 | 294 | <td><p><span class="term"><em class="parameter"><code>usn</code></em> :</span></p></td> |
325 | <td>The resource's USN | |
326 | </td> | |
295 | <td>The resource's USN</td> | |
327 | 296 | </tr> |
328 | 297 | <tr> |
329 | 298 | <td><p><span class="term"><em class="parameter"><code>locations</code></em> :</span></p></td> |
330 | <td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> of the resource's locations | |
331 | </td> | |
332 | </tr> | |
333 | <tr> | |
334 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
335 | <td> The ID of the added resource. | |
336 | </td> | |
299 | <td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> of the resource's locations</td> | |
300 | </tr> | |
301 | <tr> | |
302 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
303 | <td>The ID of the added resource.</td> | |
337 | 304 | </tr> |
338 | 305 | </tbody> |
339 | 306 | </table></div> |
350 | 317 | Adds a resource with target <em class="parameter"><code>target</code></em>, USN <em class="parameter"><code>usn</code></em>, and location <em class="parameter"><code>location</code></em> |
351 | 318 | to <em class="parameter"><code>resource_group</code></em>. |
352 | 319 | </p> |
353 | <p> | |
354 | </p> | |
355 | 320 | <div class="variablelist"><table border="0"> |
356 | 321 | <col align="left" valign="top"> |
357 | 322 | <tbody> |
362 | 327 | </tr> |
363 | 328 | <tr> |
364 | 329 | <td><p><span class="term"><em class="parameter"><code>target</code></em> :</span></p></td> |
365 | <td>The resource's target | |
366 | </td> | |
330 | <td>The resource's target</td> | |
367 | 331 | </tr> |
368 | 332 | <tr> |
369 | 333 | <td><p><span class="term"><em class="parameter"><code>usn</code></em> :</span></p></td> |
370 | <td>The resource's USN | |
371 | </td> | |
334 | <td>The resource's USN</td> | |
372 | 335 | </tr> |
373 | 336 | <tr> |
374 | 337 | <td><p><span class="term"><em class="parameter"><code>location</code></em> :</span></p></td> |
375 | <td>The resource's location | |
376 | </td> | |
377 | </tr> | |
378 | <tr> | |
379 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
380 | <td> The ID of the added resource. | |
381 | </td> | |
338 | <td>The resource's location</td> | |
339 | </tr> | |
340 | <tr> | |
341 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> | |
342 | <td>The ID of the added resource.</td> | |
382 | 343 | </tr> |
383 | 344 | </tbody> |
384 | 345 | </table></div> |
392 | 353 | <p> |
393 | 354 | Removes the resource with ID <em class="parameter"><code>resource_id</code></em> from <em class="parameter"><code>resource_group</code></em>. |
394 | 355 | </p> |
395 | <p> | |
396 | </p> | |
397 | 356 | <div class="variablelist"><table border="0"> |
398 | 357 | <col align="left" valign="top"> |
399 | 358 | <tbody> |
404 | 363 | </tr> |
405 | 364 | <tr> |
406 | 365 | <td><p><span class="term"><em class="parameter"><code>resource_id</code></em> :</span></p></td> |
407 | <td>The ID of the resource to remove | |
408 | </td> | |
366 | <td>The ID of the resource to remove</td> | |
409 | 367 | </tr> |
410 | 368 | </tbody> |
411 | 369 | </table></div> |
419 | 377 | <p> |
420 | 378 | Whether this group of resources is available or not. |
421 | 379 | </p> |
422 | <p> | |
423 | </p> | |
424 | 380 | <p>Default value: FALSE</p> |
425 | 381 | </div> |
426 | 382 | <hr> |
430 | 386 | <p> |
431 | 387 | The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> to use. |
432 | 388 | </p> |
433 | <p> | |
434 | </p> | |
435 | 389 | </div> |
436 | 390 | <hr> |
437 | 391 | <div class="refsect2"> |
440 | 394 | <p> |
441 | 395 | The number of seconds our advertisements are valid. |
442 | 396 | </p> |
443 | <p> | |
444 | </p> | |
445 | 397 | <p>Default value: 1800</p> |
446 | 398 | </div> |
447 | 399 | <hr> |
452 | 404 | The minimum number of milliseconds between SSDP messages. |
453 | 405 | The default is 20 based on DLNA specification. |
454 | 406 | </p> |
455 | <p> | |
456 | </p> | |
457 | 407 | <p>Default value: 20</p> |
458 | 408 | </div> |
459 | 409 | </div> |
460 | 410 | </div> |
461 | 411 | <div class="footer"> |
462 | 412 | <hr> |
463 | Generated by GTK-Doc V1.15.1</div> | |
413 | Generated by GTK-Doc V1.17.1</div> | |
464 | 414 | </body> |
465 | 415 | </html>⏎ |
7 | 7 | <link rel="up" href="index.html" title="GSSDP Reference Manual"> |
8 | 8 | <link rel="prev" href="index.html" title="GSSDP Reference Manual"> |
9 | 9 | <link rel="next" href="GSSDPClient.html" title="GSSDPClient"> |
10 | <meta name="generator" content="GTK-Doc V1.15.1 (XML mode)"> | |
10 | <meta name="generator" content="GTK-Doc V1.17.1 (XML mode)"> | |
11 | 11 | <link rel="stylesheet" href="style.css" type="text/css"> |
12 | 12 | </head> |
13 | 13 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
20 | 20 | </tr></table> |
21 | 21 | <div class="chapter"> |
22 | 22 | <div class="titlepage"><div><div><h2 class="title"> |
23 | <a name="id2868284"></a>GSSDP</h2></div></div></div> | |
23 | <a name="id3033626"></a>GSSDP</h2></div></div></div> | |
24 | 24 | <div class="toc"><dl> |
25 | 25 | <dt> |
26 | 26 | <span class="refentrytitle"><a href="GSSDPClient.html">GSSDPClient</a></span><span class="refpurpose"> — SSDP "bus" wrapper.</span> |
38 | 38 | </div> |
39 | 39 | <div class="footer"> |
40 | 40 | <hr> |
41 | Generated by GTK-Doc V1.15.1</div> | |
41 | Generated by GTK-Doc V1.17.1</div> | |
42 | 42 | </body> |
43 | 43 | </html>⏎ |
6 | 6 | <link rel="home" href="index.html" title="GSSDP Reference Manual"> |
7 | 7 | <link rel="up" href="ch01.html" title="GSSDP"> |
8 | 8 | <link rel="prev" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"> |
9 | <meta name="generator" content="GTK-Doc V1.15.1 (XML mode)"> | |
9 | <meta name="generator" content="GTK-Doc V1.17.1 (XML mode)"> | |
10 | 10 | <link rel="stylesheet" href="style.css" type="text/css"> |
11 | 11 | </head> |
12 | 12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
68 | 68 | </div> |
69 | 69 | <div class="footer"> |
70 | 70 | <hr> |
71 | Generated by GTK-Doc V1.15.1</div> | |
71 | Generated by GTK-Doc V1.17.1</div> | |
72 | 72 | </body> |
73 | 73 | </html>⏎ |
16 | 16 | <function name="gssdp_client_get_server_id ()" link="GSSDPClient.html#gssdp-client-get-server-id"/> |
17 | 17 | <function name="gssdp_client_get_interface ()" link="GSSDPClient.html#gssdp-client-get-interface"/> |
18 | 18 | <function name="gssdp_client_get_host_ip ()" link="GSSDPClient.html#gssdp-client-get-host-ip"/> |
19 | <function name="gssdp_client_set_network ()" link="GSSDPClient.html#gssdp-client-set-network"/> | |
20 | <function name="gssdp_client_get_network ()" link="GSSDPClient.html#gssdp-client-get-network"/> | |
19 | 21 | <function name="gssdp_client_get_active ()" link="GSSDPClient.html#gssdp-client-get-active"/> |
20 | 22 | <function name="The "active" property" link="GSSDPClient.html#GSSDPClient--active"/> |
21 | 23 | <function name="The "error" property" link="GSSDPClient.html#GSSDPClient--error"/> |
22 | 24 | <function name="The "host-ip" property" link="GSSDPClient.html#GSSDPClient--host-ip"/> |
23 | 25 | <function name="The "interface" property" link="GSSDPClient.html#GSSDPClient--interface"/> |
24 | 26 | <function name="The "main-context" property" link="GSSDPClient.html#GSSDPClient--main-context"/> |
27 | <function name="The "network" property" link="GSSDPClient.html#GSSDPClient--network"/> | |
25 | 28 | <function name="The "server-id" property" link="GSSDPClient.html#GSSDPClient--server-id"/> |
26 | 29 | <function name="The "message-received" signal" link="GSSDPClient.html#GSSDPClient-message-received"/> |
27 | 30 | <function name="GSSDPResourceBrowser" link="GSSDPResourceBrowser.html#GSSDPResourceBrowser-struct"/> |
16 | 16 | <keyword type="function" name="gssdp_client_get_server_id ()" link="GSSDPClient.html#gssdp-client-get-server-id"/> |
17 | 17 | <keyword type="function" name="gssdp_client_get_interface ()" link="GSSDPClient.html#gssdp-client-get-interface"/> |
18 | 18 | <keyword type="function" name="gssdp_client_get_host_ip ()" link="GSSDPClient.html#gssdp-client-get-host-ip"/> |
19 | <keyword type="function" name="gssdp_client_set_network ()" link="GSSDPClient.html#gssdp-client-set-network"/> | |
20 | <keyword type="function" name="gssdp_client_get_network ()" link="GSSDPClient.html#gssdp-client-get-network"/> | |
19 | 21 | <keyword type="function" name="gssdp_client_get_active ()" link="GSSDPClient.html#gssdp-client-get-active"/> |
20 | 22 | <keyword type="property" name="The "active" property" link="GSSDPClient.html#GSSDPClient--active"/> |
21 | 23 | <keyword type="property" name="The "error" property" link="GSSDPClient.html#GSSDPClient--error"/> |
22 | 24 | <keyword type="property" name="The "host-ip" property" link="GSSDPClient.html#GSSDPClient--host-ip"/> |
23 | 25 | <keyword type="property" name="The "interface" property" link="GSSDPClient.html#GSSDPClient--interface"/> |
24 | 26 | <keyword type="property" name="The "main-context" property" link="GSSDPClient.html#GSSDPClient--main-context"/> |
27 | <keyword type="property" name="The "network" property" link="GSSDPClient.html#GSSDPClient--network"/> | |
25 | 28 | <keyword type="property" name="The "server-id" property" link="GSSDPClient.html#GSSDPClient--server-id"/> |
26 | 29 | <keyword type="signal" name="The "message-received" signal" link="GSSDPClient.html#GSSDPClient-message-received"/> |
27 | 30 | <keyword type="struct" name="GSSDPResourceBrowser" link="GSSDPResourceBrowser.html#GSSDPResourceBrowser-struct"/> |
5 | 5 | <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> |
6 | 6 | <link rel="home" href="index.html" title="GSSDP Reference Manual"> |
7 | 7 | <link rel="next" href="ch01.html" title="GSSDP"> |
8 | <meta name="generator" content="GTK-Doc V1.15.1 (XML mode)"> | |
8 | <meta name="generator" content="GTK-Doc V1.17.1 (XML mode)"> | |
9 | 9 | <link rel="stylesheet" href="style.css" type="text/css"> |
10 | 10 | </head> |
11 | 11 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
13 | 13 | <div class="titlepage"> |
14 | 14 | <div> |
15 | 15 | <div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">GSSDP Reference Manual</p></th></tr></table></div> |
16 | <div><p class="releaseinfo">Version 0.8.1 | |
16 | <div><p class="releaseinfo">Version 0.10.0 | |
17 | 17 | </p></div> |
18 | 18 | <div><p class="copyright">Copyright © 2007 OpenedHand LTD</p></div> |
19 | 19 | <div><p class="copyright">Copyright © 2009 Nokia Corporation</p></div> |
20 | 20 | <div><div class="legalnotice"> |
21 | <a name="id2859107"></a><p> | |
21 | <a name="id3024449"></a><p> | |
22 | 22 | Permission is granted to copy, distribute and/or modify this |
23 | 23 | document under the terms of the <em class="citetitle">GNU Free |
24 | 24 | Documentation License</em>, Version 1.1 or any later |
62 | 62 | </div> |
63 | 63 | <div class="footer"> |
64 | 64 | <hr> |
65 | Generated by GTK-Doc V1.15.1</div> | |
65 | Generated by GTK-Doc V1.17.1</div> | |
66 | 66 | </body> |
67 | 67 | </html>⏎ |
11 | 11 | <ANCHOR id="gssdp-client-get-server-id" href="gssdp/GSSDPClient.html#gssdp-client-get-server-id"> |
12 | 12 | <ANCHOR id="gssdp-client-get-interface" href="gssdp/GSSDPClient.html#gssdp-client-get-interface"> |
13 | 13 | <ANCHOR id="gssdp-client-get-host-ip" href="gssdp/GSSDPClient.html#gssdp-client-get-host-ip"> |
14 | <ANCHOR id="gssdp-client-set-network" href="gssdp/GSSDPClient.html#gssdp-client-set-network"> | |
15 | <ANCHOR id="gssdp-client-get-network" href="gssdp/GSSDPClient.html#gssdp-client-get-network"> | |
14 | 16 | <ANCHOR id="gssdp-client-get-active" href="gssdp/GSSDPClient.html#gssdp-client-get-active"> |
15 | 17 | <ANCHOR id="GSSDPClient.property-details" href="gssdp/GSSDPClient.html#GSSDPClient.property-details"> |
16 | 18 | <ANCHOR id="GSSDPClient--active" href="gssdp/GSSDPClient.html#GSSDPClient--active"> |
18 | 20 | <ANCHOR id="GSSDPClient--host-ip" href="gssdp/GSSDPClient.html#GSSDPClient--host-ip"> |
19 | 21 | <ANCHOR id="GSSDPClient--interface" href="gssdp/GSSDPClient.html#GSSDPClient--interface"> |
20 | 22 | <ANCHOR id="GSSDPClient--main-context" href="gssdp/GSSDPClient.html#GSSDPClient--main-context"> |
23 | <ANCHOR id="GSSDPClient--network" href="gssdp/GSSDPClient.html#GSSDPClient--network"> | |
21 | 24 | <ANCHOR id="GSSDPClient--server-id" href="gssdp/GSSDPClient.html#GSSDPClient--server-id"> |
22 | 25 | <ANCHOR id="GSSDPClient.signal-details" href="gssdp/GSSDPClient.html#GSSDPClient.signal-details"> |
23 | 26 | <ANCHOR id="GSSDPClient-message-received" href="gssdp/GSSDPClient.html#GSSDPClient-message-received"> |
0 | <!-- ##### SECTION Title ##### --> | |
1 | GSSDPClient | |
2 | ||
3 | <!-- ##### SECTION Short_Description ##### --> | |
4 | ||
5 | ||
6 | <!-- ##### SECTION Long_Description ##### --> | |
7 | <para> | |
8 | ||
9 | </para> | |
10 | ||
11 | <!-- ##### SECTION See_Also ##### --> | |
12 | <para> | |
13 | ||
14 | </para> | |
15 | ||
16 | <!-- ##### SECTION Stability_Level ##### --> | |
17 | ||
18 | ||
19 | <!-- ##### SECTION Image ##### --> | |
20 | ||
21 | ||
22 | <!-- ##### STRUCT GSSDPClient ##### --> | |
23 | <para> | |
24 | ||
25 | </para> | |
26 | ||
27 | ||
28 | <!-- ##### SIGNAL GSSDPClient::message-received ##### --> | |
29 | <para> | |
30 | ||
31 | </para> | |
32 | ||
33 | @gssdpclient: the object which received the signal. | |
34 | @arg1: | |
35 | @arg2: | |
36 | @arg3: | |
37 | @arg4: | |
38 | ||
39 | <!-- ##### ARG GSSDPClient:active ##### --> | |
40 | <para> | |
41 | ||
42 | </para> | |
43 | ||
44 | <!-- ##### ARG GSSDPClient:error ##### --> | |
45 | <para> | |
46 | ||
47 | </para> | |
48 | ||
49 | <!-- ##### ARG GSSDPClient:host-ip ##### --> | |
50 | <para> | |
51 | ||
52 | </para> | |
53 | ||
54 | <!-- ##### ARG GSSDPClient:interface ##### --> | |
55 | <para> | |
56 | ||
57 | </para> | |
58 | ||
59 | <!-- ##### ARG GSSDPClient:main-context ##### --> | |
60 | <para> | |
61 | ||
62 | </para> | |
63 | ||
64 | <!-- ##### ARG GSSDPClient:server-id ##### --> | |
65 | <para> | |
66 | ||
67 | </para> | |
68 | ||
69 | <!-- ##### FUNCTION gssdp_client_new ##### --> | |
70 | <para> | |
71 | ||
72 | </para> | |
73 | ||
74 | @main_context: | |
75 | @interface: | |
76 | @error: | |
77 | @Returns: | |
78 | ||
79 | ||
80 | <!-- ##### FUNCTION gssdp_client_get_main_context ##### --> | |
81 | <para> | |
82 | ||
83 | </para> | |
84 | ||
85 | @client: | |
86 | @Returns: | |
87 | ||
88 | ||
89 | <!-- ##### FUNCTION gssdp_client_set_server_id ##### --> | |
90 | <para> | |
91 | ||
92 | </para> | |
93 | ||
94 | @client: | |
95 | @server_id: | |
96 | ||
97 | ||
98 | <!-- ##### FUNCTION gssdp_client_get_server_id ##### --> | |
99 | <para> | |
100 | ||
101 | </para> | |
102 | ||
103 | @client: | |
104 | @Returns: | |
105 | ||
106 | ||
107 | <!-- ##### FUNCTION gssdp_client_get_interface ##### --> | |
108 | <para> | |
109 | ||
110 | </para> | |
111 | ||
112 | @client: | |
113 | @Returns: | |
114 | ||
115 | ||
116 | <!-- ##### FUNCTION gssdp_client_get_host_ip ##### --> | |
117 | <para> | |
118 | ||
119 | </para> | |
120 | ||
121 | @client: | |
122 | @Returns: | |
123 | ||
124 | ||
125 | <!-- ##### FUNCTION gssdp_client_get_active ##### --> | |
126 | <para> | |
127 | ||
128 | </para> | |
129 | ||
130 | @client: | |
131 | @Returns: | |
132 | ||
133 |
0 | <!-- ##### SECTION Title ##### --> | |
1 | Error codes | |
2 | ||
3 | <!-- ##### SECTION Short_Description ##### --> | |
4 | ||
5 | ||
6 | <!-- ##### SECTION Long_Description ##### --> | |
7 | <para> | |
8 | ||
9 | </para> | |
10 | ||
11 | <!-- ##### SECTION See_Also ##### --> | |
12 | <para> | |
13 | ||
14 | </para> | |
15 | ||
16 | <!-- ##### SECTION Stability_Level ##### --> | |
17 | ||
18 | ||
19 | <!-- ##### SECTION Image ##### --> | |
20 | ||
21 | ||
22 | <!-- ##### MACRO GSSDP_ERROR ##### --> | |
23 | <para> | |
24 | ||
25 | </para> | |
26 | ||
27 | ||
28 | ||
29 | <!-- ##### ENUM GSSDPError ##### --> | |
30 | <para> | |
31 | ||
32 | </para> | |
33 | ||
34 | @GSSDP_ERROR_NO_IP_ADDRESS: | |
35 | @GSSDP_ERROR_FAILED: | |
36 |
0 | <!-- ##### SECTION Title ##### --> | |
1 | GSSDPResourceBrowser | |
2 | ||
3 | <!-- ##### SECTION Short_Description ##### --> | |
4 | ||
5 | ||
6 | <!-- ##### SECTION Long_Description ##### --> | |
7 | <para> | |
8 | ||
9 | </para> | |
10 | ||
11 | <!-- ##### SECTION See_Also ##### --> | |
12 | <para> | |
13 | ||
14 | </para> | |
15 | ||
16 | <!-- ##### SECTION Stability_Level ##### --> | |
17 | ||
18 | ||
19 | <!-- ##### SECTION Image ##### --> | |
20 | ||
21 | ||
22 | <!-- ##### STRUCT GSSDPResourceBrowser ##### --> | |
23 | <para> | |
24 | ||
25 | </para> | |
26 | ||
27 | ||
28 | <!-- ##### SIGNAL GSSDPResourceBrowser::resource-available ##### --> | |
29 | <para> | |
30 | ||
31 | </para> | |
32 | ||
33 | @gssdpresourcebrowser: the object which received the signal. | |
34 | @arg1: | |
35 | @arg2: | |
36 | ||
37 | <!-- ##### SIGNAL GSSDPResourceBrowser::resource-unavailable ##### --> | |
38 | <para> | |
39 | ||
40 | </para> | |
41 | ||
42 | @gssdpresourcebrowser: the object which received the signal. | |
43 | @arg1: | |
44 | ||
45 | <!-- ##### ARG GSSDPResourceBrowser:active ##### --> | |
46 | <para> | |
47 | ||
48 | </para> | |
49 | ||
50 | <!-- ##### ARG GSSDPResourceBrowser:client ##### --> | |
51 | <para> | |
52 | ||
53 | </para> | |
54 | ||
55 | <!-- ##### ARG GSSDPResourceBrowser:mx ##### --> | |
56 | <para> | |
57 | ||
58 | </para> | |
59 | ||
60 | <!-- ##### ARG GSSDPResourceBrowser:target ##### --> | |
61 | <para> | |
62 | ||
63 | </para> | |
64 | ||
65 | <!-- ##### MACRO GSSDP_ALL_RESOURCES ##### --> | |
66 | <para> | |
67 | ||
68 | </para> | |
69 | ||
70 | ||
71 | ||
72 | <!-- ##### FUNCTION gssdp_resource_browser_new ##### --> | |
73 | <para> | |
74 | ||
75 | </para> | |
76 | ||
77 | @client: | |
78 | @target: | |
79 | @Returns: | |
80 | ||
81 | ||
82 | <!-- ##### FUNCTION gssdp_resource_browser_get_client ##### --> | |
83 | <para> | |
84 | ||
85 | </para> | |
86 | ||
87 | @resource_browser: | |
88 | @Returns: | |
89 | ||
90 | ||
91 | <!-- ##### FUNCTION gssdp_resource_browser_set_target ##### --> | |
92 | <para> | |
93 | ||
94 | </para> | |
95 | ||
96 | @resource_browser: | |
97 | @target: | |
98 | ||
99 | ||
100 | <!-- ##### FUNCTION gssdp_resource_browser_get_target ##### --> | |
101 | <para> | |
102 | ||
103 | </para> | |
104 | ||
105 | @resource_browser: | |
106 | @Returns: | |
107 | ||
108 | ||
109 | <!-- ##### FUNCTION gssdp_resource_browser_set_mx ##### --> | |
110 | <para> | |
111 | ||
112 | </para> | |
113 | ||
114 | @resource_browser: | |
115 | @mx: | |
116 | ||
117 | ||
118 | <!-- ##### FUNCTION gssdp_resource_browser_get_mx ##### --> | |
119 | <para> | |
120 | ||
121 | </para> | |
122 | ||
123 | @resource_browser: | |
124 | @Returns: | |
125 | ||
126 | ||
127 | <!-- ##### FUNCTION gssdp_resource_browser_set_active ##### --> | |
128 | <para> | |
129 | ||
130 | </para> | |
131 | ||
132 | @resource_browser: | |
133 | @active: | |
134 | ||
135 | ||
136 | <!-- ##### FUNCTION gssdp_resource_browser_get_active ##### --> | |
137 | <para> | |
138 | ||
139 | </para> | |
140 | ||
141 | @resource_browser: | |
142 | @Returns: | |
143 | ||
144 |
0 | <!-- ##### SECTION Title ##### --> | |
1 | GSSDPResourceGroup | |
2 | ||
3 | <!-- ##### SECTION Short_Description ##### --> | |
4 | ||
5 | ||
6 | <!-- ##### SECTION Long_Description ##### --> | |
7 | <para> | |
8 | ||
9 | </para> | |
10 | ||
11 | <!-- ##### SECTION See_Also ##### --> | |
12 | <para> | |
13 | ||
14 | </para> | |
15 | ||
16 | <!-- ##### SECTION Stability_Level ##### --> | |
17 | ||
18 | ||
19 | <!-- ##### SECTION Image ##### --> | |
20 | ||
21 | ||
22 | <!-- ##### STRUCT GSSDPResourceGroup ##### --> | |
23 | <para> | |
24 | ||
25 | </para> | |
26 | ||
27 | ||
28 | <!-- ##### ARG GSSDPResourceGroup:available ##### --> | |
29 | <para> | |
30 | ||
31 | </para> | |
32 | ||
33 | <!-- ##### ARG GSSDPResourceGroup:client ##### --> | |
34 | <para> | |
35 | ||
36 | </para> | |
37 | ||
38 | <!-- ##### ARG GSSDPResourceGroup:max-age ##### --> | |
39 | <para> | |
40 | ||
41 | </para> | |
42 | ||
43 | <!-- ##### ARG GSSDPResourceGroup:message-delay ##### --> | |
44 | <para> | |
45 | ||
46 | </para> | |
47 | ||
48 | <!-- ##### FUNCTION gssdp_resource_group_new ##### --> | |
49 | <para> | |
50 | ||
51 | </para> | |
52 | ||
53 | @client: | |
54 | @Returns: | |
55 | ||
56 | ||
57 | <!-- ##### FUNCTION gssdp_resource_group_get_client ##### --> | |
58 | <para> | |
59 | ||
60 | </para> | |
61 | ||
62 | @resource_group: | |
63 | @Returns: | |
64 | ||
65 | ||
66 | <!-- ##### FUNCTION gssdp_resource_group_set_max_age ##### --> | |
67 | <para> | |
68 | ||
69 | </para> | |
70 | ||
71 | @resource_group: | |
72 | @max_age: | |
73 | ||
74 | ||
75 | <!-- ##### FUNCTION gssdp_resource_group_get_max_age ##### --> | |
76 | <para> | |
77 | ||
78 | </para> | |
79 | ||
80 | @resource_group: | |
81 | @Returns: | |
82 | ||
83 | ||
84 | <!-- ##### FUNCTION gssdp_resource_group_set_available ##### --> | |
85 | <para> | |
86 | ||
87 | </para> | |
88 | ||
89 | @resource_group: | |
90 | @available: | |
91 | ||
92 | ||
93 | <!-- ##### FUNCTION gssdp_resource_group_get_available ##### --> | |
94 | <para> | |
95 | ||
96 | </para> | |
97 | ||
98 | @resource_group: | |
99 | @Returns: | |
100 | ||
101 | ||
102 | <!-- ##### FUNCTION gssdp_resource_group_set_message_delay ##### --> | |
103 | <para> | |
104 | ||
105 | </para> | |
106 | ||
107 | @resource_group: | |
108 | @message_delay: | |
109 | ||
110 | ||
111 | <!-- ##### FUNCTION gssdp_resource_group_get_message_delay ##### --> | |
112 | <para> | |
113 | ||
114 | </para> | |
115 | ||
116 | @resource_group: | |
117 | @Returns: | |
118 | ||
119 | ||
120 | <!-- ##### FUNCTION gssdp_resource_group_add_resource ##### --> | |
121 | <para> | |
122 | ||
123 | </para> | |
124 | ||
125 | @resource_group: | |
126 | @target: | |
127 | @usn: | |
128 | @locations: | |
129 | @Returns: | |
130 | ||
131 | ||
132 | <!-- ##### FUNCTION gssdp_resource_group_add_resource_simple ##### --> | |
133 | <para> | |
134 | ||
135 | </para> | |
136 | ||
137 | @resource_group: | |
138 | @target: | |
139 | @usn: | |
140 | @location: | |
141 | @Returns: | |
142 | ||
143 | ||
144 | <!-- ##### FUNCTION gssdp_resource_group_remove_resource ##### --> | |
145 | <para> | |
146 | ||
147 | </para> | |
148 | ||
149 | @resource_group: | |
150 | @resource_id: | |
151 | ||
152 |
0 | <!-- ##### SECTION Title ##### --> | |
1 | gssdp | |
2 | ||
3 | <!-- ##### SECTION Short_Description ##### --> | |
4 | ||
5 | ||
6 | <!-- ##### SECTION Long_Description ##### --> | |
7 | <para> | |
8 | ||
9 | </para> | |
10 | ||
11 | <!-- ##### SECTION See_Also ##### --> | |
12 | <para> | |
13 | ||
14 | </para> | |
15 | ||
16 | <!-- ##### SECTION Stability_Level ##### --> | |
17 | ||
18 | ||
19 | <!-- ##### SECTION Image ##### --> | |
20 | ||
21 |
22 | 22 | |
23 | 23 | TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) |
24 | 24 | |
25 | EXTRA_DIST = \ | |
25 | SETUP_FILES = \ | |
26 | 26 | $(content_files) \ |
27 | $(HTML_IMAGES) \ | |
28 | 27 | $(DOC_MAIN_SGML_FILE) \ |
29 | 28 | $(DOC_MODULE)-sections.txt \ |
30 | 29 | $(DOC_MODULE)-overrides.txt |
31 | 30 | |
32 | DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ | |
33 | pdf-build.stamp \ | |
34 | $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \ | |
35 | $(srcdir)/pdf.stamp | |
31 | EXTRA_DIST = \ | |
32 | $(SETUP_FILES) | |
33 | ||
34 | DOC_STAMPS=setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ | |
35 | html-build.stamp pdf-build.stamp \ | |
36 | setup.stamp tmpl.stamp sgml.stamp html.stamp pdf.stamp | |
36 | 37 | |
37 | 38 | SCANOBJ_FILES = \ |
38 | 39 | $(DOC_MODULE).args \ |
69 | 70 | |
70 | 71 | $(REPORT_FILES): sgml-build.stamp |
71 | 72 | |
73 | #### setup #### | |
74 | ||
75 | setup-build.stamp: | |
76 | -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ | |
77 | echo 'gtk-doc: Preparing build'; \ | |
78 | files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ | |
79 | if test "x$$files" != "x" ; then \ | |
80 | for file in $$files ; do \ | |
81 | test -f $(abs_srcdir)/$$file && \ | |
82 | cp -p $(abs_srcdir)/$$file $(abs_builddir)/; \ | |
83 | done \ | |
84 | fi; \ | |
85 | test -f $(abs_srcdir)/tmpl && \ | |
86 | cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ | |
87 | fi | |
88 | @touch setup-build.stamp | |
89 | ||
90 | ||
91 | setup.stamp: setup-build.stamp | |
92 | @true | |
93 | ||
94 | ||
72 | 95 | #### scan #### |
73 | 96 | |
74 | 97 | scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) |
75 | 98 | @echo 'gtk-doc: Scanning header files' |
76 | @-chmod -R u+w $(srcdir) | |
77 | @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ | |
99 | @_source_dir='' ; \ | |
100 | for i in $(DOC_SOURCE_DIR) ; do \ | |
78 | 101 | _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
79 | done ; \ | |
80 | cd $(srcdir) && \ | |
81 | gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) | |
82 | @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ | |
83 | CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ | |
102 | done ; \ | |
103 | gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) | |
104 | @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ | |
105 | CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) ; \ | |
84 | 106 | else \ |
85 | cd $(srcdir) ; \ | |
86 | 107 | for i in $(SCANOBJ_FILES) ; do \ |
87 | 108 | test -f $$i || touch $$i ; \ |
88 | 109 | done \ |
94 | 115 | |
95 | 116 | #### templates #### |
96 | 117 | |
97 | tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt | |
118 | tmpl-build.stamp: setup.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt | |
98 | 119 | @echo 'gtk-doc: Rebuilding template files' |
99 | @-chmod -R u+w $(srcdir) | |
100 | @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) | |
120 | @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) | |
121 | @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ | |
122 | if test -w $(abs_srcdir) ; then \ | |
123 | cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ | |
124 | fi \ | |
125 | fi | |
101 | 126 | @touch tmpl-build.stamp |
102 | 127 | |
103 | 128 | tmpl.stamp: tmpl-build.stamp |
111 | 136 | sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) |
112 | 137 | @echo 'gtk-doc: Building XML' |
113 | 138 | @-chmod -R u+w $(srcdir) |
114 | @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ | |
139 | @_source_dir='' ; \ | |
140 | for i in $(DOC_SOURCE_DIR) ; do \ | |
115 | 141 | _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
116 | done ; \ | |
117 | cd $(srcdir) && \ | |
118 | gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) | |
142 | done ; \ | |
143 | gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) | |
119 | 144 | @touch sgml-build.stamp |
120 | 145 | |
121 | 146 | sgml.stamp: sgml-build.stamp |
125 | 150 | |
126 | 151 | html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) |
127 | 152 | @echo 'gtk-doc: Building HTML' |
128 | @-chmod -R u+w $(srcdir) | |
129 | @rm -rf $(srcdir)/html | |
130 | @mkdir $(srcdir)/html | |
153 | @rm -rf html | |
154 | @mkdir html | |
131 | 155 | @mkhtml_options=""; \ |
132 | 156 | gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ |
133 | 157 | if test "$(?)" = "0"; then \ |
134 | mkhtml_options=--path="$(srcdir)"; \ | |
158 | mkhtml_options=--path="$(abs_srcdir)"; \ | |
135 | 159 | fi; \ |
136 | cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) | |
137 | @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) | |
160 | cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) | |
161 | -@test "x$(HTML_IMAGES)" = "x" || \ | |
162 | for file in $(HTML_IMAGES) ; do \ | |
163 | if test -f $(abs_srcdir)/$$file ; then \ | |
164 | cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ | |
165 | fi; \ | |
166 | if test -f $(abs_builddir)/$$file ; then \ | |
167 | cp $(abs_builddir)/$$file $(abs_builddir)/html; \ | |
168 | fi; \ | |
169 | done; | |
138 | 170 | @echo 'gtk-doc: Fixing cross-references' |
139 | @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) | |
171 | @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) | |
140 | 172 | @touch html-build.stamp |
141 | 173 | |
142 | 174 | #### pdf #### |
143 | 175 | |
144 | 176 | pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) |
145 | 177 | @echo 'gtk-doc: Building PDF' |
146 | @-chmod -R u+w $(srcdir) | |
147 | @rm -rf $(srcdir)/$(DOC_MODULE).pdf | |
178 | @rm -rf $(DOC_MODULE).pdf | |
148 | 179 | @mkpdf_imgdirs=""; \ |
149 | 180 | if test "x$(HTML_IMAGES)" != "x"; then \ |
150 | 181 | for img in $(HTML_IMAGES); do \ |
155 | 186 | fi; \ |
156 | 187 | done; \ |
157 | 188 | fi; \ |
158 | cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) | |
189 | gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) | |
159 | 190 | @touch pdf-build.stamp |
160 | 191 | |
161 | 192 | ############## |
165 | 196 | rm -rf .libs |
166 | 197 | |
167 | 198 | distclean-local: |
168 | cd $(srcdir) && \ | |
169 | rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \ | |
170 | $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt | |
199 | rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ | |
200 | $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt | |
201 | if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ | |
202 | rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ | |
203 | rm -rf tmpl; \ | |
204 | fi | |
171 | 205 | |
172 | 206 | maintainer-clean-local: clean |
173 | cd $(srcdir) && rm -rf xml html | |
207 | rm -rf xml html | |
174 | 208 | |
175 | 209 | install-data-local: |
176 | 210 | @installfiles=`echo $(srcdir)/html/*`; \ |
218 | 252 | dist-hook: dist-check-gtkdoc dist-hook-local |
219 | 253 | mkdir $(distdir)/tmpl |
220 | 254 | mkdir $(distdir)/html |
221 | -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl | |
222 | cp $(srcdir)/html/* $(distdir)/html | |
223 | -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/ | |
224 | -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ | |
225 | -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ | |
255 | -cp $(build)/tmpl/*.sgml $(distdir)/tmpl | |
256 | cp $(builddir)/html/* $(distdir)/html | |
257 | -cp $(builddir)/$(DOC_MODULE).pdf $(distdir)/ | |
258 | -cp $(build)/$(DOC_MODULE).types $(distdir)/ | |
259 | -cp $(build)/$(DOC_MODULE)-sections.txt $(distdir)/ | |
226 | 260 | cd $(distdir) && rm -f $(DISTCLEANFILES) |
227 | 261 | $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html |
228 | 262 |
41 | 41 | gssdp-resource-group.c \ |
42 | 42 | gssdp-socket-source.c \ |
43 | 43 | gssdp-socket-source.h \ |
44 | gssdp-socket-functions.c \ | |
45 | gssdp-socket-functions.h \ | |
44 | 46 | $(BUILT_SOURCES) |
45 | 47 | |
46 | 48 | libgssdp_1_0_la_LIBADD = $(LIBGSSDP_LIBS) |
49 | ||
50 | if OS_WIN32 | |
51 | ||
52 | libgssdp_1_0_la_LIBADD += -lws2_32 -liphlpapi | |
53 | libgssdp_1_0_la_LDFLAGS += -no-undefined | |
54 | endif | |
47 | 55 | |
48 | 56 | EXTRA_DIST = gssdp-marshal.list |
49 | 57 |
45 | 45 | POST_UNINSTALL = : |
46 | 46 | build_triplet = @build@ |
47 | 47 | host_triplet = @host@ |
48 | @OS_WIN32_TRUE@am__append_1 = -lws2_32 -liphlpapi | |
49 | @OS_WIN32_TRUE@am__append_2 = -no-undefined | |
48 | 50 | subdir = libgssdp |
49 | 51 | DIST_COMMON = $(libgssdpinc_HEADERS) $(srcdir)/Makefile.am \ |
50 | 52 | $(srcdir)/Makefile.in |
81 | 83 | "$(DESTDIR)$(typelibdir)" "$(DESTDIR)$(libgssdpincdir)" |
82 | 84 | LTLIBRARIES = $(lib_LTLIBRARIES) |
83 | 85 | am__DEPENDENCIES_1 = |
84 | libgssdp_1_0_la_DEPENDENCIES = $(am__DEPENDENCIES_1) | |
86 | libgssdp_1_0_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ | |
87 | $(am__DEPENDENCIES_1) | |
85 | 88 | am__objects_1 = gssdp-marshal.lo |
86 | 89 | am_libgssdp_1_0_la_OBJECTS = gssdp-client.lo gssdp-error.lo \ |
87 | 90 | gssdp-resource-browser.lo gssdp-resource-group.lo \ |
88 | gssdp-socket-source.lo $(am__objects_1) | |
91 | gssdp-socket-source.lo gssdp-socket-functions.lo \ | |
92 | $(am__objects_1) | |
89 | 93 | libgssdp_1_0_la_OBJECTS = $(am_libgssdp_1_0_la_OBJECTS) |
90 | 94 | AM_V_lt = $(am__v_lt_$(V)) |
91 | 95 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) |
269 | 273 | gssdp.h |
270 | 274 | |
271 | 275 | BUILT_SOURCES = gssdp-marshal.c gssdp-marshal.h |
272 | libgssdp_1_0_la_LDFLAGS = -version-info $(LTVERSION) | |
276 | libgssdp_1_0_la_LDFLAGS = -version-info $(LTVERSION) $(am__append_2) | |
273 | 277 | libgssdp_1_0_la_SOURCES = gssdp-client.c \ |
274 | 278 | gssdp-client-private.h \ |
275 | 279 | gssdp-error.c \ |
278 | 282 | gssdp-resource-group.c \ |
279 | 283 | gssdp-socket-source.c \ |
280 | 284 | gssdp-socket-source.h \ |
285 | gssdp-socket-functions.c \ | |
286 | gssdp-socket-functions.h \ | |
281 | 287 | $(BUILT_SOURCES) |
282 | 288 | |
283 | libgssdp_1_0_la_LIBADD = $(LIBGSSDP_LIBS) | |
289 | libgssdp_1_0_la_LIBADD = $(LIBGSSDP_LIBS) $(am__append_1) | |
284 | 290 | EXTRA_DIST = gssdp-marshal.list |
285 | 291 | @HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0 |
286 | 292 | @HAVE_INTROSPECTION_TRUE@gir_DATA = GSSDP-1.0.gir |
369 | 375 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gssdp-marshal.Plo@am__quote@ |
370 | 376 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gssdp-resource-browser.Plo@am__quote@ |
371 | 377 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gssdp-resource-group.Plo@am__quote@ |
378 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gssdp-socket-functions.Plo@am__quote@ | |
372 | 379 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gssdp-socket-source.Plo@am__quote@ |
373 | 380 | |
374 | 381 | .c.o: |
30 | 30 | */ |
31 | 31 | |
32 | 32 | #include <config.h> |
33 | #include <sys/types.h> | |
34 | #include <glib.h> | |
35 | #ifndef G_OS_WIN32 | |
33 | 36 | #include <sys/socket.h> |
34 | #include <sys/types.h> | |
35 | 37 | #include <sys/utsname.h> |
36 | 38 | #include <netinet/in.h> |
37 | 39 | #include <arpa/inet.h> |
40 | #else | |
41 | #define _WIN32_WINNT 0x502 | |
42 | #include <winsock2.h> | |
43 | #include <ws2tcpip.h> | |
44 | #include <iphlpapi.h> | |
45 | typedef int socklen_t; | |
46 | /* from the return value of inet_addr */ | |
47 | typedef unsigned long in_addr_t; | |
48 | #endif | |
38 | 49 | #include <string.h> |
39 | 50 | #include <stdio.h> |
40 | 51 | #include <errno.h> |
41 | 52 | #include <unistd.h> |
53 | #ifndef G_OS_WIN32 | |
42 | 54 | #include <arpa/inet.h> |
43 | 55 | #include <net/if.h> |
44 | 56 | #include <ifaddrs.h> |
57 | #endif | |
45 | 58 | #include <libsoup/soup-headers.h> |
46 | 59 | |
47 | 60 | #include "gssdp-client.h" |
51 | 64 | #include "gssdp-marshal.h" |
52 | 65 | #include "gssdp-protocol.h" |
53 | 66 | |
67 | #ifndef INET6_ADDRSTRLEN | |
68 | #define INET6_ADDRSTRLEN 46 | |
69 | #endif | |
70 | ||
54 | 71 | /* Size of the buffer used for reading from the socket */ |
55 | 72 | #define BUF_SIZE 1024 |
56 | 73 | |
62 | 79 | GMainContext *main_context; |
63 | 80 | |
64 | 81 | char *server_id; |
65 | char *interface; | |
82 | char *iface; | |
66 | 83 | char *host_ip; |
84 | char *network; | |
67 | 85 | |
68 | 86 | GError **error; |
69 | 87 | |
78 | 96 | PROP_MAIN_CONTEXT, |
79 | 97 | PROP_SERVER_ID, |
80 | 98 | PROP_IFACE, |
99 | PROP_NETWORK, | |
81 | 100 | PROP_HOST_IP, |
82 | 101 | PROP_ACTIVE, |
83 | 102 | PROP_ERROR |
97 | 116 | static char * |
98 | 117 | make_server_id (void); |
99 | 118 | static gboolean |
100 | request_socket_source_cb (gpointer user_data); | |
119 | request_socket_source_cb (GIOChannel *source, | |
120 | GIOCondition condition, | |
121 | gpointer user_data); | |
101 | 122 | static gboolean |
102 | multicast_socket_source_cb (gpointer user_data); | |
123 | multicast_socket_source_cb (GIOChannel *source, | |
124 | GIOCondition condition, | |
125 | gpointer user_data); | |
103 | 126 | static gboolean |
104 | 127 | init_network_info (GSSDPClient *client); |
105 | 128 | |
121 | 144 | gssdp_client_constructed (GObject *object) |
122 | 145 | { |
123 | 146 | GSSDPClient *client = GSSDP_CLIENT (object); |
147 | GError *error = NULL; | |
148 | #ifdef G_OS_WIN32 | |
149 | WSADATA wsaData = {0}; | |
150 | if (WSAStartup (MAKEWORD (2,2), &wsaData) != 0) { | |
151 | gchar *message; | |
152 | ||
153 | message = g_win32_error_message (WSAGetLastError ()); | |
154 | g_set_error_literal (client->priv->error, | |
155 | GSSDP_ERROR, | |
156 | GSSDP_ERROR_FAILED, | |
157 | message); | |
158 | g_free (message); | |
159 | } | |
160 | #endif | |
124 | 161 | |
125 | 162 | /* Make sure all network info is available to us */ |
126 | 163 | if (!init_network_info (client)) |
129 | 166 | /* Set up sockets (Will set errno if it failed) */ |
130 | 167 | client->priv->request_socket = |
131 | 168 | gssdp_socket_source_new (GSSDP_SOCKET_SOURCE_TYPE_REQUEST, |
132 | gssdp_client_get_host_ip (client)); | |
169 | gssdp_client_get_host_ip (client), | |
170 | &error); | |
133 | 171 | if (client->priv->request_socket != NULL) { |
134 | g_source_set_callback | |
135 | ((GSource *) client->priv->request_socket, | |
136 | request_socket_source_cb, | |
137 | client, | |
138 | NULL); | |
172 | gssdp_socket_source_set_callback | |
173 | (client->priv->request_socket, | |
174 | (GSourceFunc) request_socket_source_cb, | |
175 | client); | |
139 | 176 | } else { |
140 | 177 | goto errors; |
141 | 178 | } |
142 | 179 | |
143 | 180 | client->priv->multicast_socket = |
144 | 181 | gssdp_socket_source_new (GSSDP_SOCKET_SOURCE_TYPE_MULTICAST, |
145 | gssdp_client_get_host_ip (client)); | |
182 | gssdp_client_get_host_ip (client), | |
183 | &error); | |
146 | 184 | if (client->priv->multicast_socket != NULL) { |
147 | g_source_set_callback | |
148 | ((GSource *) client->priv->multicast_socket, | |
149 | multicast_socket_source_cb, | |
150 | client, | |
151 | NULL); | |
185 | gssdp_socket_source_set_callback | |
186 | (client->priv->multicast_socket, | |
187 | (GSourceFunc) multicast_socket_source_cb, | |
188 | client); | |
152 | 189 | } |
153 | 190 | |
154 | 191 | errors: |
155 | 192 | if (!client->priv->request_socket || !client->priv->multicast_socket) { |
156 | if (client->priv->error) | |
157 | g_set_error_literal (client->priv->error, | |
158 | GSSDP_ERROR, | |
159 | GSSDP_ERROR_FAILED, | |
160 | g_strerror (errno)); | |
161 | ||
193 | if (client->priv->error) { | |
194 | g_propagate_error (client->priv->error, error); | |
195 | } | |
162 | 196 | return; |
163 | 197 | } |
164 | 198 | |
165 | g_source_attach ((GSource *) client->priv->request_socket, | |
166 | client->priv->main_context); | |
167 | g_source_unref ((GSource *) client->priv->request_socket); | |
168 | ||
169 | g_source_attach ((GSource *) client->priv->multicast_socket, | |
170 | client->priv->main_context); | |
171 | g_source_unref ((GSource *) client->priv->multicast_socket); | |
199 | gssdp_socket_source_attach (client->priv->request_socket, | |
200 | client->priv->main_context); | |
201 | ||
202 | gssdp_socket_source_attach (client->priv->multicast_socket, | |
203 | client->priv->main_context); | |
172 | 204 | } |
173 | 205 | |
174 | 206 | static void |
197 | 229 | g_value_set_string (value, |
198 | 230 | gssdp_client_get_interface (client)); |
199 | 231 | break; |
232 | case PROP_NETWORK: | |
233 | g_value_set_string (value, | |
234 | gssdp_client_get_network (client)); | |
235 | break; | |
200 | 236 | case PROP_HOST_IP: |
201 | 237 | g_value_set_string (value, |
202 | 238 | gssdp_client_get_host_ip (client)); |
233 | 269 | client->priv->error = g_value_get_pointer (value); |
234 | 270 | break; |
235 | 271 | case PROP_IFACE: |
236 | client->priv->interface = g_value_dup_string (value); | |
272 | client->priv->iface = g_value_dup_string (value); | |
273 | break; | |
274 | case PROP_NETWORK: | |
275 | client->priv->network = g_value_dup_string (value); | |
237 | 276 | break; |
238 | 277 | case PROP_ACTIVE: |
239 | 278 | client->priv->active = g_value_get_boolean (value); |
253 | 292 | |
254 | 293 | /* Destroy the SocketSources */ |
255 | 294 | if (client->priv->request_socket) { |
256 | g_source_destroy ((GSource *) client->priv->request_socket); | |
295 | g_object_unref (client->priv->request_socket); | |
257 | 296 | client->priv->request_socket = NULL; |
258 | 297 | } |
259 | 298 | |
260 | 299 | if (client->priv->multicast_socket) { |
261 | g_source_destroy ((GSource *) client->priv->multicast_socket); | |
300 | g_object_unref (client->priv->multicast_socket); | |
262 | 301 | client->priv->multicast_socket = NULL; |
263 | 302 | } |
264 | 303 | |
277 | 316 | GSSDPClient *client; |
278 | 317 | |
279 | 318 | client = GSSDP_CLIENT (object); |
319 | #ifdef G_OS_WIN32 | |
320 | WSACleanup (); | |
321 | #endif | |
280 | 322 | |
281 | 323 | g_free (client->priv->server_id); |
282 | g_free (client->priv->interface); | |
324 | g_free (client->priv->iface); | |
283 | 325 | g_free (client->priv->host_ip); |
326 | g_free (client->priv->network); | |
284 | 327 | |
285 | 328 | G_OBJECT_CLASS (gssdp_client_parent_class)->finalize (object); |
286 | 329 | } |
368 | 411 | NULL, |
369 | 412 | G_PARAM_READWRITE | |
370 | 413 | G_PARAM_CONSTRUCT_ONLY | |
414 | G_PARAM_STATIC_NAME | | |
415 | G_PARAM_STATIC_NICK | | |
416 | G_PARAM_STATIC_BLURB)); | |
417 | ||
418 | /** | |
419 | * GSSDPClient:network | |
420 | * | |
421 | * The network this client is currently connected to. You could set this | |
422 | * to anything you want to identify the network this client is | |
423 | * associated with. If you are using #GUPnPContextManager and associated | |
424 | * interface is a WiFi interface, this property is set to the ESSID of | |
425 | * the network. Otherwise, expect this to be the network IP address by | |
426 | * default. | |
427 | **/ | |
428 | g_object_class_install_property | |
429 | (object_class, | |
430 | PROP_NETWORK, | |
431 | g_param_spec_string | |
432 | ("network", | |
433 | "Network ID", | |
434 | "The network this client is currently connected to.", | |
435 | NULL, | |
436 | G_PARAM_READWRITE | | |
437 | G_PARAM_CONSTRUCT | | |
371 | 438 | G_PARAM_STATIC_NAME | |
372 | 439 | G_PARAM_STATIC_NICK | |
373 | 440 | G_PARAM_STATIC_BLURB)); |
443 | 510 | **/ |
444 | 511 | GSSDPClient * |
445 | 512 | gssdp_client_new (GMainContext *main_context, |
446 | const char *interface, | |
513 | const char *iface, | |
447 | 514 | GError **error) |
448 | 515 | { |
449 | 516 | return g_object_new (GSSDP_TYPE_CLIENT, |
450 | 517 | "main-context", main_context, |
451 | "interface", interface, | |
518 | "interface", iface, | |
452 | 519 | "error", error, |
453 | 520 | NULL); |
454 | 521 | } |
534 | 601 | { |
535 | 602 | g_return_val_if_fail (GSSDP_IS_CLIENT (client), NULL); |
536 | 603 | |
537 | return client->priv->interface; | |
604 | return client->priv->iface; | |
538 | 605 | } |
539 | 606 | |
540 | 607 | /** |
551 | 618 | g_return_val_if_fail (GSSDP_IS_CLIENT (client), NULL); |
552 | 619 | |
553 | 620 | return client->priv->host_ip; |
621 | } | |
622 | ||
623 | /** | |
624 | * gssdp_client_set_network | |
625 | * @client: A #GSSDPClient | |
626 | * @network: The string identifying the network | |
627 | * | |
628 | * Sets the network identification of @client to @network. | |
629 | **/ | |
630 | void | |
631 | gssdp_client_set_network (GSSDPClient *client, | |
632 | const char *network) | |
633 | { | |
634 | g_return_if_fail (GSSDP_IS_CLIENT (client)); | |
635 | ||
636 | if (client->priv->network) { | |
637 | g_free (client->priv->network); | |
638 | client->priv->network = NULL; | |
639 | } | |
640 | ||
641 | if (network) | |
642 | client->priv->network = g_strdup (network); | |
643 | ||
644 | g_object_notify (G_OBJECT (client), "network"); | |
645 | } | |
646 | ||
647 | /** | |
648 | * gssdp_client_get_network | |
649 | * @client: A #GSSDPClient | |
650 | * | |
651 | * Get the network this client is associated with. | |
652 | * | |
653 | * Return value: The network identification. This string should not be freed. | |
654 | **/ | |
655 | const char * | |
656 | gssdp_client_get_network (GSSDPClient *client) | |
657 | { | |
658 | g_return_val_if_fail (GSSDP_IS_CLIENT (client), NULL); | |
659 | ||
660 | return client->priv->network; | |
554 | 661 | } |
555 | 662 | |
556 | 663 | /** |
582 | 689 | gushort dest_port, |
583 | 690 | const char *message) |
584 | 691 | { |
585 | struct sockaddr_in addr; | |
586 | int socket_fd, res; | |
692 | gssize res; | |
693 | GError *error = NULL; | |
694 | GSocket *socket = NULL; | |
695 | GInetAddress *inet_address = NULL; | |
696 | GSocketAddress *address = NULL; | |
587 | 697 | |
588 | 698 | g_return_if_fail (GSSDP_IS_CLIENT (client)); |
589 | 699 | g_return_if_fail (message != NULL); |
600 | 710 | if (dest_port == 0) |
601 | 711 | dest_port = SSDP_PORT; |
602 | 712 | |
603 | socket_fd = gssdp_socket_source_get_fd (client->priv->request_socket); | |
604 | ||
605 | memset (&addr, 0, sizeof (addr)); | |
606 | ||
607 | addr.sin_family = AF_INET; | |
608 | addr.sin_port = htons (dest_port); | |
609 | addr.sin_addr.s_addr = inet_addr (dest_ip); | |
610 | ||
611 | res = sendto (socket_fd, | |
612 | message, | |
613 | strlen (message), | |
614 | 0, | |
615 | (struct sockaddr *) &addr, | |
616 | sizeof (addr)); | |
713 | inet_address = g_inet_address_new_from_string (dest_ip); | |
714 | address = g_inet_socket_address_new (inet_address, dest_port); | |
715 | socket = gssdp_socket_source_get_socket (client->priv->request_socket); | |
716 | res = g_socket_send_to (socket, | |
717 | address, | |
718 | message, | |
719 | strlen (message), | |
720 | NULL, | |
721 | &error); | |
617 | 722 | |
618 | 723 | if (res == -1) { |
619 | g_warning ("sendto: Error %d sending message: %s", | |
620 | errno, strerror (errno)); | |
621 | } | |
724 | g_warning ("Error sending SSDP packet to %s: %s", | |
725 | dest_ip, | |
726 | error->message); | |
727 | g_error_free (error); | |
728 | } | |
729 | ||
730 | g_object_unref (address); | |
731 | g_object_unref (inet_address); | |
622 | 732 | } |
623 | 733 | |
624 | 734 | /** |
627 | 737 | static char * |
628 | 738 | make_server_id (void) |
629 | 739 | { |
740 | #ifdef G_OS_WIN32 | |
741 | OSVERSIONINFO versioninfo; | |
742 | versioninfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); | |
743 | if (GetVersionEx (&versioninfo)) { | |
744 | return g_strdup_printf ("Microsoft Windows/%ld.%ld GSSDP/%s", | |
745 | versioninfo.dwMajorVersion, | |
746 | versioninfo.dwMinorVersion, | |
747 | VERSION); | |
748 | } else { | |
749 | return g_strdup_printf ("Microsoft Windows GSSDP/%s", | |
750 | VERSION); | |
751 | } | |
752 | #else | |
630 | 753 | struct utsname sysinfo; |
631 | 754 | |
632 | 755 | uname (&sysinfo); |
635 | 758 | sysinfo.sysname, |
636 | 759 | sysinfo.version, |
637 | 760 | VERSION); |
761 | #endif | |
638 | 762 | } |
639 | 763 | |
640 | 764 | static gboolean |
705 | 829 | } |
706 | 830 | } |
707 | 831 | |
832 | #ifdef G_OS_WIN32 | |
833 | static in_addr_t | |
834 | inet_netof (struct in_addr in) { | |
835 | in_addr_t i = ntohl(in.s_addr); | |
836 | ||
837 | if (IN_CLASSA (i)) | |
838 | return (((i) & IN_CLASSA_NET) >> IN_CLASSA_NSHIFT); | |
839 | else if (IN_CLASSB (i)) | |
840 | return (((i) & IN_CLASSB_NET) >> IN_CLASSB_NSHIFT); | |
841 | else | |
842 | return (((i) & IN_CLASSC_NET) >> IN_CLASSC_NSHIFT); | |
843 | } | |
844 | #endif | |
845 | ||
708 | 846 | /** |
709 | 847 | * Called when data can be read from the socket |
710 | 848 | **/ |
711 | 849 | static gboolean |
712 | socket_source_cb (GSSDPSocketSource *socket, GSSDPClient *client) | |
713 | { | |
714 | int fd, type, len; | |
715 | ssize_t bytes; | |
850 | socket_source_cb (GSSDPSocketSource *socket_source, GSSDPClient *client) | |
851 | { | |
852 | int type, len; | |
716 | 853 | char buf[BUF_SIZE], *end; |
854 | SoupMessageHeaders *headers = NULL; | |
855 | GSocket *socket; | |
856 | GSocketAddress *address = NULL; | |
857 | gssize bytes; | |
858 | GInetAddress *inetaddr; | |
859 | char *ip_string = NULL; | |
860 | guint16 port; | |
861 | GError *error = NULL; | |
862 | in_addr_t recv_network; | |
863 | in_addr_t our_network; | |
864 | struct in_addr our_addr; | |
717 | 865 | struct sockaddr_in addr; |
718 | socklen_t addr_size; | |
719 | SoupMessageHeaders *headers; | |
720 | struct in_addr our_addr; | |
721 | in_addr_t our_network; | |
722 | in_addr_t recv_network; | |
723 | ||
724 | /* Get FD */ | |
725 | fd = gssdp_socket_source_get_fd (socket); | |
726 | ||
727 | /* Read data */ | |
728 | addr_size = sizeof (addr); | |
729 | ||
730 | bytes = recvfrom (fd, | |
731 | buf, | |
732 | BUF_SIZE - 1, /* Leave space for trailing \0 */ | |
733 | MSG_TRUNC, | |
734 | (struct sockaddr *) &addr, | |
735 | &addr_size); | |
866 | ||
867 | /* Get Socket */ | |
868 | socket = gssdp_socket_source_get_socket (socket_source); | |
869 | bytes = g_socket_receive_from (socket, | |
870 | &address, | |
871 | buf, | |
872 | BUF_SIZE - 1, | |
873 | NULL, | |
874 | &error); | |
736 | 875 | if (bytes == -1) { |
737 | g_warning ("Failed to read from socket: %d (%s)", | |
738 | errno, | |
739 | strerror (errno)); | |
740 | ||
741 | return TRUE; | |
876 | g_warning ("Failed to receive from socket: %s", | |
877 | error->message); | |
878 | ||
879 | goto out; | |
742 | 880 | } |
743 | 881 | |
744 | 882 | /* We need the following lines to make sure the right client received |
747 | 885 | * on this socket from a particular interface but AFAIK that is not |
748 | 886 | * possible, at least not in a portable way. |
749 | 887 | */ |
888 | ||
889 | if (!g_socket_address_to_native (address, | |
890 | &addr, | |
891 | sizeof (struct sockaddr_in), | |
892 | &error)) { | |
893 | g_warning ("Could not convert address to native: %s", | |
894 | error->message); | |
895 | ||
896 | goto out; | |
897 | } | |
898 | ||
750 | 899 | recv_network = inet_netof (addr.sin_addr); |
751 | 900 | our_addr.s_addr = inet_addr (gssdp_client_get_host_ip (client)); |
752 | 901 | our_network = inet_netof (our_addr); |
753 | 902 | if (recv_network != our_network) |
754 | return TRUE; | |
903 | goto out; | |
755 | 904 | |
756 | 905 | if (bytes >= BUF_SIZE) { |
757 | 906 | g_warning ("Received packet of %u bytes, but the maximum " |
758 | 907 | "buffer size is %d. Packed dropped.", |
759 | 908 | (unsigned int) bytes, BUF_SIZE); |
760 | 909 | |
761 | return TRUE; | |
910 | goto out; | |
762 | 911 | } |
763 | 912 | |
764 | 913 | /* Add trailing \0 */ |
770 | 919 | g_warning ("Received packet lacks \"\\r\\n\\r\\n\" sequence. " |
771 | 920 | "Packed dropped."); |
772 | 921 | |
773 | return TRUE; | |
922 | goto out; | |
774 | 923 | } |
775 | 924 | |
776 | 925 | len = end - buf + 2; |
792 | 941 | } |
793 | 942 | |
794 | 943 | /* Emit signal if parsing succeeded */ |
944 | inetaddr = g_inet_socket_address_get_address ( | |
945 | G_INET_SOCKET_ADDRESS (address)); | |
946 | ip_string = g_inet_address_to_string (inetaddr); | |
947 | port = g_inet_socket_address_get_port ( | |
948 | G_INET_SOCKET_ADDRESS (address)); | |
795 | 949 | if (type >= 0) { |
796 | 950 | g_signal_emit (client, |
797 | 951 | signals[MESSAGE_RECEIVED], |
798 | 952 | 0, |
799 | inet_ntoa (addr.sin_addr), | |
800 | ntohs (addr.sin_port), | |
953 | ip_string, | |
954 | port, | |
801 | 955 | type, |
802 | 956 | headers); |
803 | 957 | } |
804 | 958 | |
959 | out: | |
960 | if (error) | |
961 | g_error_free (error); | |
962 | ||
963 | if (ip_string) | |
964 | g_free (ip_string); | |
965 | ||
805 | 966 | if (headers) |
806 | 967 | soup_message_headers_free (headers); |
807 | 968 | |
969 | if (address) | |
970 | g_object_unref (address); | |
971 | ||
808 | 972 | return TRUE; |
809 | 973 | } |
810 | 974 | |
811 | 975 | static gboolean |
812 | request_socket_source_cb (gpointer user_data) | |
976 | request_socket_source_cb (GIOChannel *source, | |
977 | GIOCondition condition, | |
978 | gpointer user_data) | |
813 | 979 | { |
814 | 980 | GSSDPClient *client; |
815 | 981 | |
819 | 985 | } |
820 | 986 | |
821 | 987 | static gboolean |
822 | multicast_socket_source_cb (gpointer user_data) | |
988 | multicast_socket_source_cb (GIOChannel *source, | |
989 | GIOCondition condition, | |
990 | gpointer user_data) | |
823 | 991 | { |
824 | 992 | GSSDPClient *client; |
825 | 993 | |
827 | 995 | |
828 | 996 | return socket_source_cb (client->priv->multicast_socket, client); |
829 | 997 | } |
998 | ||
999 | #ifdef G_OS_WIN32 | |
1000 | static gboolean | |
1001 | is_primary_adapter (PIP_ADAPTER_ADDRESSES adapter) | |
1002 | { | |
1003 | int family = | |
1004 | adapter->FirstUnicastAddress->Address.lpSockaddr->sa_family; | |
1005 | ||
1006 | return !(adapter->IfType == IF_TYPE_SOFTWARE_LOOPBACK || | |
1007 | family == AF_INET6); | |
1008 | } | |
1009 | ||
1010 | static gboolean | |
1011 | extract_address_and_prefix (PIP_ADAPTER_UNICAST_ADDRESS adapter, | |
1012 | PIP_ADAPTER_PREFIX prefix, | |
1013 | char *iface, | |
1014 | char *network) { | |
1015 | DWORD ret = 0; | |
1016 | DWORD len = INET6_ADDRSTRLEN; | |
1017 | ||
1018 | ret = WSAAddressToStringA (adapter->Address.lpSockaddr, | |
1019 | adapter->Address.iSockaddrLength, | |
1020 | NULL, | |
1021 | iface, | |
1022 | &len); | |
1023 | if (ret != 0) | |
1024 | return FALSE; | |
1025 | ||
1026 | if (prefix) { | |
1027 | ret = WSAAddressToStringA (prefix->Address.lpSockaddr, | |
1028 | prefix->Address.iSockaddrLength, | |
1029 | NULL, | |
1030 | network, | |
1031 | &len); | |
1032 | if (ret != 0) | |
1033 | return FALSE; | |
1034 | } else if (strcmp (iface, "127.0.0.1")) | |
1035 | strcpy (network, "127.0.0.0"); | |
1036 | else | |
1037 | return FALSE; | |
1038 | ||
1039 | return TRUE; | |
1040 | } | |
1041 | #endif | |
830 | 1042 | |
831 | 1043 | /* |
832 | 1044 | * Get the host IP for the specified interface. If no interface is specified, |
833 | 1045 | * it gets the IP of the first up & running interface and sets @interface |
834 | 1046 | * appropriately. |
835 | 1047 | */ |
1048 | ||
836 | 1049 | static char * |
837 | get_host_ip (char **interface) | |
838 | { | |
1050 | get_host_ip (char **iface, char **network) | |
1051 | { | |
1052 | #ifdef G_OS_WIN32 | |
1053 | char *addr = NULL; | |
1054 | GList *up_ifaces = NULL, *ifaceptr = NULL; | |
1055 | ULONG flags = GAA_FLAG_INCLUDE_PREFIX | | |
1056 | GAA_FLAG_SKIP_DNS_SERVER | | |
1057 | GAA_FLAG_SKIP_MULTICAST; | |
1058 | DWORD size = 15360; /* Use 15k buffer initially as documented in MSDN */ | |
1059 | DWORD ret; | |
1060 | PIP_ADAPTER_ADDRESSES adapters_addresses; | |
1061 | PIP_ADAPTER_ADDRESSES adapter; | |
1062 | ||
1063 | do { | |
1064 | adapters_addresses = (PIP_ADAPTER_ADDRESSES) g_malloc0 (size); | |
1065 | ret = GetAdaptersAddresses (AF_UNSPEC, | |
1066 | flags, | |
1067 | NULL, | |
1068 | adapters_addresses, | |
1069 | &size); | |
1070 | if (ret == ERROR_BUFFER_OVERFLOW) | |
1071 | g_free (adapters_addresses); | |
1072 | } while (ret == ERROR_BUFFER_OVERFLOW); | |
1073 | ||
1074 | if (ret == ERROR_SUCCESS) | |
1075 | for (adapter = adapters_addresses; | |
1076 | adapter != NULL; | |
1077 | adapter = adapter->Next) { | |
1078 | if (adapter->FirstUnicastAddress == NULL) | |
1079 | continue; | |
1080 | if (adapter->OperStatus != IfOperStatusUp) | |
1081 | continue; | |
1082 | /* skip Point-to-Point devices */ | |
1083 | if (adapter->IfType == IF_TYPE_PPP) | |
1084 | continue; | |
1085 | ||
1086 | if (*iface != NULL && | |
1087 | strcmp (*iface, adapter->AdapterName) != 0) | |
1088 | continue; | |
1089 | ||
1090 | /* I think that IPv6 is done via pseudo-adapters, so | |
1091 | * that there are either IPv4 or IPv6 addresses defined | |
1092 | * on the adapter. | |
1093 | * Loopback-Devices and IPv6 go to the end of the list, | |
1094 | * IPv4 to the front | |
1095 | */ | |
1096 | if (is_primary_adapter (adapter)) | |
1097 | up_ifaces = g_list_prepend (up_ifaces, adapter); | |
1098 | else | |
1099 | up_ifaces = g_list_append (up_ifaces, adapter); | |
1100 | } | |
1101 | ||
1102 | for (ifaceptr = up_ifaces; | |
1103 | ifaceptr != NULL; | |
1104 | ifaceptr = ifaceptr->next) { | |
1105 | char ip[INET6_ADDRSTRLEN]; | |
1106 | char prefix[INET6_ADDRSTRLEN]; | |
1107 | const char *p, *q; | |
1108 | PIP_ADAPTER_ADDRESSES adapter; | |
1109 | PIP_ADAPTER_UNICAST_ADDRESS address; | |
1110 | ||
1111 | p = NULL; | |
1112 | ||
1113 | adapter = (PIP_ADAPTER_ADDRESSES) ifaceptr->data; | |
1114 | address = adapter->FirstUnicastAddress; | |
1115 | ||
1116 | switch (address->Address.lpSockaddr->sa_family) { | |
1117 | case AF_INET: | |
1118 | case AF_INET6: | |
1119 | if (extract_address_and_prefix ( | |
1120 | address, | |
1121 | adapter->FirstPrefix, | |
1122 | ip, | |
1123 | prefix)) { | |
1124 | p = ip; | |
1125 | q = prefix; | |
1126 | } | |
1127 | break; | |
1128 | default: | |
1129 | continue; | |
1130 | } | |
1131 | ||
1132 | if (p != NULL) { | |
1133 | addr = g_strdup (p); | |
1134 | if (*iface == NULL) | |
1135 | *iface = g_strdup (adapter->AdapterName); | |
1136 | if (*network == NULL) | |
1137 | *network = g_strdup (q); | |
1138 | break; | |
1139 | } | |
1140 | ||
1141 | } | |
1142 | g_list_free (up_ifaces); | |
1143 | g_free (adapters_addresses); | |
1144 | ||
1145 | return addr; | |
1146 | #else | |
839 | 1147 | struct ifaddrs *ifa_list, *ifa; |
840 | 1148 | char *ret; |
841 | GList *up_ifaces, *iface; | |
1149 | GList *up_ifaces, *ifaceptr; | |
842 | 1150 | |
843 | 1151 | ret = NULL; |
844 | 1152 | up_ifaces = NULL; |
854 | 1162 | if (ifa->ifa_addr == NULL) |
855 | 1163 | continue; |
856 | 1164 | |
857 | if (*interface && strcmp (*interface, ifa->ifa_name) != 0) | |
1165 | if (*iface && strcmp (*iface, ifa->ifa_name) != 0) | |
858 | 1166 | continue; |
859 | 1167 | else if (!(ifa->ifa_flags & IFF_UP)) |
860 | 1168 | continue; |
869 | 1177 | up_ifaces = g_list_prepend (up_ifaces, ifa); |
870 | 1178 | } |
871 | 1179 | |
872 | for (iface = up_ifaces; iface != NULL; iface = iface->next) { | |
1180 | for (ifaceptr = up_ifaces; | |
1181 | ifaceptr != NULL; | |
1182 | ifaceptr = ifaceptr->next) { | |
873 | 1183 | char ip[INET6_ADDRSTRLEN]; |
874 | const char *p; | |
875 | struct sockaddr_in *s4; | |
876 | struct sockaddr_in6 *s6; | |
1184 | char net[INET6_ADDRSTRLEN]; | |
1185 | const char *p, *q; | |
1186 | int i = 0; | |
1187 | struct sockaddr_in *s4, *s4_mask; | |
1188 | struct sockaddr_in6 *s6, *s6_mask; | |
1189 | struct in_addr net_addr; | |
1190 | struct in6_addr net6_addr; | |
877 | 1191 | |
878 | 1192 | p = NULL; |
879 | 1193 | |
880 | ifa = iface->data; | |
1194 | ifa = ifaceptr->data; | |
881 | 1195 | |
882 | 1196 | switch (ifa->ifa_addr->sa_family) { |
883 | 1197 | case AF_INET: |
884 | 1198 | s4 = (struct sockaddr_in *) ifa->ifa_addr; |
885 | 1199 | p = inet_ntop (AF_INET, |
886 | 1200 | &s4->sin_addr, ip, sizeof (ip)); |
1201 | s4_mask = (struct sockaddr_in *) ifa->ifa_netmask; | |
1202 | net_addr.s_addr = (in_addr_t) s4->sin_addr.s_addr & | |
1203 | (in_addr_t) s4_mask->sin_addr.s_addr; | |
1204 | q = inet_ntop (AF_INET, &net_addr, net, sizeof (net)); | |
887 | 1205 | break; |
888 | 1206 | case AF_INET6: |
889 | 1207 | s6 = (struct sockaddr_in6 *) ifa->ifa_addr; |
890 | 1208 | p = inet_ntop (AF_INET6, |
891 | 1209 | &s6->sin6_addr, ip, sizeof (ip)); |
1210 | s6_mask = (struct sockaddr_in6 *) ifa->ifa_netmask; | |
1211 | /* FIXME: Is this the right way to calculate this? */ | |
1212 | /* FIXME: Does this work on big endian machines? */ | |
1213 | for (i = 0; i < 16; ++i) { | |
1214 | net6_addr.s6_addr[i] = | |
1215 | s6->sin6_addr.s6_addr[i] & | |
1216 | s6_mask->sin6_addr.s6_addr[i]; | |
1217 | } | |
1218 | q = inet_ntop (AF_INET6, &net6_addr, net, sizeof (net)); | |
892 | 1219 | break; |
893 | 1220 | default: |
894 | 1221 | continue; /* Unknown: ignore */ |
897 | 1224 | if (p != NULL) { |
898 | 1225 | ret = g_strdup (p); |
899 | 1226 | |
900 | if (*interface == NULL) | |
901 | *interface = g_strdup (ifa->ifa_name); | |
1227 | if (*iface == NULL) | |
1228 | *iface = g_strdup (ifa->ifa_name); | |
1229 | if (*network == NULL) | |
1230 | *network = g_strdup (q); | |
902 | 1231 | break; |
903 | 1232 | } |
904 | 1233 | } |
907 | 1236 | freeifaddrs (ifa_list); |
908 | 1237 | |
909 | 1238 | return ret; |
1239 | #endif | |
910 | 1240 | } |
911 | 1241 | |
912 | 1242 | static gboolean |
914 | 1244 | { |
915 | 1245 | gboolean ret = TRUE; |
916 | 1246 | |
917 | if (client->priv->interface == NULL || client->priv->host_ip == NULL) | |
1247 | if (client->priv->iface == NULL || client->priv->host_ip == NULL) | |
918 | 1248 | client->priv->host_ip = |
919 | get_host_ip (&client->priv->interface); | |
920 | ||
921 | if (client->priv->interface == NULL) { | |
1249 | get_host_ip (&client->priv->iface, | |
1250 | &client->priv->network); | |
1251 | ||
1252 | if (client->priv->iface == NULL) { | |
922 | 1253 | if (client->priv->error) |
923 | 1254 | g_set_error (client->priv->error, |
924 | 1255 | GSSDP_ERROR, |
932 | 1263 | GSSDP_ERROR, |
933 | 1264 | GSSDP_ERROR_NO_IP_ADDRESS, |
934 | 1265 | "Failed to find IP of interface %s", |
935 | client->priv->interface); | |
1266 | client->priv->iface); | |
936 | 1267 | |
937 | 1268 | ret = FALSE; |
938 | 1269 | } |
69 | 69 | |
70 | 70 | GSSDPClient * |
71 | 71 | gssdp_client_new (GMainContext *main_context, |
72 | const char *interface, | |
72 | const char *iface, | |
73 | 73 | GError **error); |
74 | 74 | |
75 | 75 | GMainContext * |
88 | 88 | const char * |
89 | 89 | gssdp_client_get_host_ip (GSSDPClient *client); |
90 | 90 | |
91 | void | |
92 | gssdp_client_set_network (GSSDPClient *client, | |
93 | const char *network); | |
94 | ||
95 | const char * | |
96 | gssdp_client_get_network (GSSDPClient *client); | |
97 | ||
91 | 98 | gboolean |
92 | 99 | gssdp_client_get_active (GSSDPClient *client); |
93 | 100 |
58 | 58 | "NT: %s\r\n" \ |
59 | 59 | "USN: %s\r\n\r\n" |
60 | 60 | |
61 | #define SSDP_ALIVE_MESSAGE_WITH_VERSION \ | |
62 | "NOTIFY * HTTP/1.1\r\n" \ | |
63 | "Host: " SSDP_ADDR ":" SSDP_PORT_STR "\r\n" \ | |
64 | "Cache-Control: max-age=%d\r\n" \ | |
65 | "Location: %s\r\n" \ | |
66 | "%s" \ | |
67 | "Server: %s\r\n" \ | |
68 | "NTS: ssdp:alive\r\n" \ | |
69 | "NT: %s%d\r\n" \ | |
70 | "USN: %s\r\n\r\n" | |
71 | ||
61 | 72 | #define SSDP_BYEBYE_MESSAGE \ |
62 | 73 | "NOTIFY * HTTP/1.1\r\n" \ |
63 | 74 | "Host: " SSDP_ADDR ":" SSDP_PORT_STR "\r\n" \ |
64 | 75 | "NTS: ssdp:byebye\r\n" \ |
65 | 76 | "NT: %s\r\n" \ |
77 | "USN: %s\r\n\r\n" | |
78 | ||
79 | #define SSDP_BYEBYE_MESSAGE_WITH_VERSION \ | |
80 | "NOTIFY * HTTP/1.1\r\n" \ | |
81 | "Host: " SSDP_ADDR ":" SSDP_PORT_STR "\r\n" \ | |
82 | "NTS: ssdp:byebye\r\n" \ | |
83 | "NT: %s%d\r\n" \ | |
66 | 84 | "USN: %s\r\n\r\n" |
67 | 85 | |
68 | 86 | #define SSDP_SEARCH_METHOD "M-SEARCH" |
579 | 579 | static gboolean |
580 | 580 | resource_expire (gpointer user_data) |
581 | 581 | { |
582 | GSSDPResourceBrowser *resource_browser; | |
582 | 583 | Resource *resource; |
583 | 584 | char *usn; |
584 | 585 | |
585 | 586 | resource = user_data; |
587 | resource_browser = resource->resource_browser; | |
586 | 588 | |
587 | 589 | /* Steal the USN pointer from the resource as we need it for the signal |
588 | 590 | * emission. |
592 | 594 | |
593 | 595 | g_hash_table_remove (resource->resource_browser->priv->resources, usn); |
594 | 596 | |
595 | g_signal_emit (resource->resource_browser, | |
597 | g_signal_emit (resource_browser, | |
596 | 598 | signals[RESOURCE_UNAVAILABLE], |
597 | 599 | 0, |
598 | 600 | usn); |
96 | 96 | } DiscoveryResponse; |
97 | 97 | |
98 | 98 | #define DEFAULT_MESSAGE_DELAY 20 |
99 | #define VERSION_PATTERN "[0-9]+$" | |
99 | 100 | |
100 | 101 | /* Function prototypes */ |
101 | 102 | static void |
122 | 123 | discovery_response_free (DiscoveryResponse *response); |
123 | 124 | static gboolean |
124 | 125 | process_queue (gpointer data); |
126 | static char * | |
127 | get_version_for_target (char *target); | |
125 | 128 | static GRegex * |
126 | 129 | create_target_regex (const char *target, |
127 | 130 | GError **error); |
502 | 505 | GMainContext *context; |
503 | 506 | int timeout; |
504 | 507 | |
505 | /* We want to re-announce before actually timing out */ | |
508 | /* We want to re-announce at least 3 times before the resource | |
509 | * group expires to cope with the unrelialble nature of UDP. | |
510 | * | |
511 | * Read the paragraphs about 'CACHE-CONTROL' on pages 21-22 of | |
512 | * UPnP Device Architecture Document v1.1 for further details. | |
513 | * */ | |
506 | 514 | timeout = resource_group->priv->max_age; |
507 | if (timeout > 2) | |
508 | timeout = timeout / 2 - 1; | |
515 | if (G_LIKELY (timeout > 6)) | |
516 | timeout = (timeout / 3) - 1; | |
509 | 517 | |
510 | 518 | /* Add re-announcement timer */ |
511 | 519 | resource_group->priv->timeout_src = |
973 | 981 | } |
974 | 982 | |
975 | 983 | /** |
976 | * Send ssdp:alive message for @resource | |
984 | * Add ssdp:alive messages for the given resource to sending queue | |
985 | **/ | |
986 | static void | |
987 | queue_alive_messages (GSSDPResourceGroup *resource_group, | |
988 | guint max_age, | |
989 | const char *location, | |
990 | const char *al, | |
991 | const char *server_id, | |
992 | const char *target, | |
993 | const char *usn) | |
994 | { | |
995 | char *version_str; | |
996 | char *message; | |
997 | ||
998 | version_str = get_version_for_target ((char *) target); | |
999 | if (version_str != NULL) { | |
1000 | char *_target; | |
1001 | int version; | |
1002 | ||
1003 | version = atoi (version_str); | |
1004 | _target = g_strndup (target, version_str - target); | |
1005 | ||
1006 | while (version > 0) { | |
1007 | message = g_strdup_printf | |
1008 | (SSDP_ALIVE_MESSAGE_WITH_VERSION, | |
1009 | max_age, | |
1010 | location, | |
1011 | al, | |
1012 | server_id, | |
1013 | _target, | |
1014 | version, | |
1015 | usn); | |
1016 | ||
1017 | queue_message (resource_group, message); | |
1018 | ||
1019 | version--; | |
1020 | } | |
1021 | ||
1022 | g_free (_target); | |
1023 | } else { | |
1024 | message = g_strdup_printf (SSDP_ALIVE_MESSAGE, | |
1025 | max_age, | |
1026 | location, | |
1027 | al, | |
1028 | server_id, | |
1029 | target, | |
1030 | usn); | |
1031 | ||
1032 | queue_message (resource_group, message); | |
1033 | } | |
1034 | } | |
1035 | ||
1036 | /** | |
1037 | * Send ssdp:alive messages for @resource | |
977 | 1038 | **/ |
978 | 1039 | static void |
979 | 1040 | resource_alive (Resource *resource) |
980 | 1041 | { |
981 | 1042 | GSSDPClient *client; |
982 | 1043 | guint max_age; |
983 | char *al, *message; | |
1044 | char *al; | |
984 | 1045 | |
985 | 1046 | if (!resource->initial_alive_sent) { |
986 | 1047 | /* Unannounce before first announce. This is done to |
998 | 1059 | |
999 | 1060 | al = construct_al (resource); |
1000 | 1061 | |
1001 | message = g_strdup_printf (SSDP_ALIVE_MESSAGE, | |
1002 | max_age, | |
1003 | (char *) resource->locations->data, | |
1004 | al ? al : "", | |
1005 | gssdp_client_get_server_id (client), | |
1006 | resource->target, | |
1007 | resource->usn); | |
1008 | ||
1009 | queue_message (resource->resource_group, message); | |
1062 | queue_alive_messages (resource->resource_group, | |
1063 | max_age, | |
1064 | (const char *) resource->locations->data, | |
1065 | al ? al : "", | |
1066 | gssdp_client_get_server_id (client), | |
1067 | resource->target, | |
1068 | resource->usn); | |
1010 | 1069 | |
1011 | 1070 | g_free (al); |
1012 | 1071 | } |
1017 | 1076 | static void |
1018 | 1077 | resource_byebye (Resource *resource) |
1019 | 1078 | { |
1079 | char *version_str; | |
1020 | 1080 | char *message; |
1021 | 1081 | |
1022 | /* Queue message */ | |
1023 | message = g_strdup_printf (SSDP_BYEBYE_MESSAGE, | |
1024 | resource->target, | |
1025 | resource->usn); | |
1026 | ||
1027 | queue_message (resource->resource_group, message); | |
1082 | version_str = get_version_for_target (resource->target); | |
1083 | if (version_str != NULL) { | |
1084 | char *_target; | |
1085 | int version; | |
1086 | ||
1087 | version = atoi (version_str); | |
1088 | _target = g_strndup (resource->target, | |
1089 | version_str - resource->target); | |
1090 | ||
1091 | while (version > 0) { | |
1092 | message = g_strdup_printf | |
1093 | (SSDP_BYEBYE_MESSAGE_WITH_VERSION, | |
1094 | _target, | |
1095 | version, | |
1096 | resource->usn); | |
1097 | ||
1098 | queue_message (resource->resource_group, message); | |
1099 | ||
1100 | version--; | |
1101 | } | |
1102 | ||
1103 | g_free (_target); | |
1104 | } else { | |
1105 | message = g_strdup_printf (SSDP_BYEBYE_MESSAGE, | |
1106 | resource->target, | |
1107 | resource->usn); | |
1108 | ||
1109 | queue_message (resource->resource_group, message); | |
1110 | } | |
1028 | 1111 | } |
1029 | 1112 | |
1030 | 1113 | /** |
1054 | 1137 | g_slice_free (Resource, resource); |
1055 | 1138 | } |
1056 | 1139 | |
1140 | /* Gets you the pointer to the version part in the target string */ | |
1141 | static char * | |
1142 | get_version_for_target (char *target) | |
1143 | { | |
1144 | char *version; | |
1145 | ||
1146 | if (strncmp (target, "urn:", 4) != 0) { | |
1147 | /* target is not a URN so no version. */ | |
1148 | return NULL; | |
1149 | } | |
1150 | ||
1151 | version = g_strrstr (target, ":") + 1; | |
1152 | if (version == NULL || | |
1153 | !g_regex_match_simple (VERSION_PATTERN, version, 0, 0)) | |
1154 | return NULL; | |
1155 | ||
1156 | return version; | |
1157 | } | |
1158 | ||
1057 | 1159 | static GRegex * |
1058 | 1160 | create_target_regex (const char *target, GError **error) |
1059 | 1161 | { |
1060 | 1162 | GRegex *regex; |
1061 | 1163 | char *pattern; |
1062 | 1164 | char *version; |
1063 | char *version_pattern; | |
1064 | ||
1065 | if (strncmp (target, "urn:", 4) != 0) { | |
1066 | /* target is not a URN, No need to deal with version. */ | |
1067 | return g_regex_new (target, 0, 0, error); | |
1068 | } | |
1069 | ||
1070 | version_pattern = "[0-9]+$"; | |
1165 | ||
1071 | 1166 | /* Make sure we have enough room for version pattern */ |
1072 | 1167 | pattern = g_strndup (target, |
1073 | strlen (target) + strlen (version_pattern)); | |
1074 | ||
1075 | version = g_strrstr (pattern, ":") + 1; | |
1076 | if (version != NULL && | |
1077 | g_regex_match_simple (version_pattern, version, 0, 0)) { | |
1078 | strcpy (version, version_pattern); | |
1079 | } | |
1168 | strlen (target) + strlen (VERSION_PATTERN)); | |
1169 | ||
1170 | version = get_version_for_target (pattern); | |
1171 | if (version != NULL) | |
1172 | strcpy (version, VERSION_PATTERN); | |
1080 | 1173 | |
1081 | 1174 | regex = g_regex_new (pattern, 0, 0, error); |
1082 | 1175 |
0 | /* | |
1 | * Copyright (C) 2010 Jens Georg <mail@jensge.org> | |
2 | * | |
3 | * Author: Jens Georg <mail@jensge.org> | |
4 | * | |
5 | * This library is free software; you can redistribute it and/or | |
6 | * modify it under the terms of the GNU Library General Public | |
7 | * License as published by the Free Software Foundation; either | |
8 | * version 2 of the License, or (at your option) any later version. | |
9 | * | |
10 | * This library is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Library General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Library General Public | |
16 | * License along with this library; if not, write to the | |
17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
18 | * Boston, MA 02111-1307, USA. | |
19 | */ | |
20 | ||
21 | #include <errno.h> | |
22 | #include <string.h> | |
23 | ||
24 | #include <glib.h> | |
25 | ||
26 | #ifdef G_OS_WIN32 | |
27 | #include <winsock2.h> | |
28 | #include <ws2tcpip.h> | |
29 | typedef int socklen_t; | |
30 | #else | |
31 | #include <sys/socket.h> | |
32 | #include <sys/types.h> | |
33 | #include <netinet/in.h> | |
34 | #include <arpa/inet.h> | |
35 | #endif | |
36 | ||
37 | #include "gssdp-error.h" | |
38 | #include "gssdp-socket-functions.h" | |
39 | ||
40 | static char* | |
41 | gssdp_socket_error_message (int error) { | |
42 | #ifdef G_OS_WIN32 | |
43 | return g_win32_error_message (error); | |
44 | #else | |
45 | return g_strdup (g_strerror (error)); | |
46 | #endif | |
47 | } | |
48 | ||
49 | static int | |
50 | gssdp_socket_errno () { | |
51 | #ifdef G_OS_WIN32 | |
52 | return WSAGetLastError (); | |
53 | #else | |
54 | return errno; | |
55 | #endif | |
56 | } | |
57 | ||
58 | ||
59 | static gboolean | |
60 | gssdp_socket_option_set (GSocket *socket, | |
61 | int level, | |
62 | int option, | |
63 | const void *optval, | |
64 | socklen_t optlen, | |
65 | GError **error) { | |
66 | int res; | |
67 | ||
68 | res = setsockopt (g_socket_get_fd (socket), | |
69 | level, | |
70 | option, | |
71 | optval, | |
72 | optlen); | |
73 | ||
74 | if (res == -1) { | |
75 | char *message; | |
76 | int error_code; | |
77 | ||
78 | error_code = gssdp_socket_errno (); | |
79 | message = gssdp_socket_error_message (error_code); | |
80 | g_set_error_literal (error, | |
81 | GSSDP_ERROR, | |
82 | GSSDP_ERROR_FAILED, | |
83 | message); | |
84 | g_free (message); | |
85 | } | |
86 | ||
87 | return res != -1; | |
88 | } | |
89 | ||
90 | gboolean | |
91 | gssdp_socket_enable_loop (GSocket *socket, | |
92 | gboolean enable, | |
93 | GError **error) { | |
94 | return gssdp_socket_option_set (socket, | |
95 | IPPROTO_IP, | |
96 | IP_MULTICAST_LOOP, | |
97 | (char *) &enable, | |
98 | sizeof (enable), | |
99 | error); | |
100 | } | |
101 | ||
102 | gboolean | |
103 | gssdp_socket_set_ttl (GSocket *socket, | |
104 | int ttl, | |
105 | GError **error) { | |
106 | return gssdp_socket_option_set (socket, | |
107 | IPPROTO_IP, | |
108 | IP_MULTICAST_TTL, | |
109 | (char *) &ttl, | |
110 | sizeof (ttl), | |
111 | error); | |
112 | } | |
113 | ||
114 | gboolean | |
115 | gssdp_socket_enable_broadcast (GSocket *socket, | |
116 | gboolean enable, | |
117 | GError **error) { | |
118 | return gssdp_socket_option_set (socket, | |
119 | SOL_SOCKET, | |
120 | SO_BROADCAST, | |
121 | (char *) &enable, | |
122 | sizeof (enable), | |
123 | error); | |
124 | } | |
125 | ||
126 | gboolean | |
127 | gssdp_socket_mcast_interface_set (GSocket *socket, | |
128 | GInetAddress *iface_address, | |
129 | GError **error) { | |
130 | ||
131 | const guint8 *address; | |
132 | gsize native_size; | |
133 | ||
134 | address = g_inet_address_to_bytes (iface_address); | |
135 | native_size = g_inet_address_get_native_size (iface_address); | |
136 | ||
137 | return gssdp_socket_option_set (socket, | |
138 | IPPROTO_IP, | |
139 | IP_MULTICAST_IF, | |
140 | (char *) address, | |
141 | native_size, | |
142 | error); | |
143 | } | |
144 | ||
145 | #ifdef G_OS_WIN32 | |
146 | gboolean | |
147 | gssdp_socket_reuse_address (GSocket *socket, | |
148 | gboolean enable, | |
149 | GError **error) { | |
150 | return gssdp_socket_option_set (socket, | |
151 | SOL_SOCKET, | |
152 | SO_REUSEADDR, | |
153 | (char *) &enable, | |
154 | sizeof (enable), | |
155 | error); | |
156 | } | |
157 | #endif | |
158 | ||
159 | ||
160 | /* | |
161 | * Iface may be NULL if no special interface is wanted | |
162 | */ | |
163 | gboolean | |
164 | gssdp_socket_mcast_group_join (GSocket *socket, | |
165 | GInetAddress *group, | |
166 | GInetAddress *iface, | |
167 | GError **error) { | |
168 | struct ip_mreq mreq; | |
169 | GError *inner_error = NULL; | |
170 | gboolean result; | |
171 | #ifdef G_OS_WIN32 | |
172 | GSocketAddress *local_address; | |
173 | #endif | |
174 | if (group == NULL || ! G_IS_INET_ADDRESS (group)) { | |
175 | g_set_error_literal (error, | |
176 | GSSDP_ERROR, | |
177 | GSSDP_ERROR_NO_IP_ADDRESS, | |
178 | "Address is not a valid address"); | |
179 | ||
180 | return FALSE; | |
181 | } | |
182 | ||
183 | if (!g_inet_address_get_is_multicast (group)) { | |
184 | char *address; | |
185 | ||
186 | address = g_inet_address_to_string (group); | |
187 | g_set_error (error, | |
188 | GSSDP_ERROR, | |
189 | GSSDP_ERROR_FAILED, | |
190 | "Address '%s' is not a multicast address", | |
191 | address); | |
192 | g_free (address); | |
193 | ||
194 | return FALSE; | |
195 | } | |
196 | ||
197 | if (g_inet_address_get_family (group) != G_SOCKET_FAMILY_IPV4) { | |
198 | g_set_error_literal (error, | |
199 | GSSDP_ERROR, | |
200 | GSSDP_ERROR_FAILED, | |
201 | "IPv6 not supported"); | |
202 | ||
203 | return FALSE; | |
204 | } | |
205 | #ifdef G_OS_WIN32 | |
206 | /* On Window, it is only possible to join multicast groups on a bound | |
207 | * socket | |
208 | * Note: This test is valid on Windows only. On linux, local_addres | |
209 | * will be the ANY address (0.0.0.0 for IPv4) | |
210 | */ | |
211 | local_address = g_socket_get_local_address (socket, &inner_error); | |
212 | if (local_address == NULL) { | |
213 | g_set_error_literal (error, | |
214 | GSSDP_ERROR, | |
215 | GSSDP_ERROR_FAILED, | |
216 | "Cannot join multicast group;" | |
217 | "socket is not bound"); | |
218 | ||
219 | return FALSE; | |
220 | } | |
221 | g_object_unref (local_address); | |
222 | #endif | |
223 | ||
224 | memset (&mreq, 0, sizeof (struct ip_mreq)); | |
225 | memcpy (&(mreq.imr_multiaddr), | |
226 | g_inet_address_to_bytes (group), | |
227 | g_inet_address_get_native_size (group)); | |
228 | ||
229 | /* if omitted, join will fail if there isn't an explicit multicast | |
230 | * route or a default route | |
231 | */ | |
232 | if (iface != NULL) | |
233 | memcpy (&(mreq.imr_interface), | |
234 | g_inet_address_to_bytes (iface), | |
235 | g_inet_address_get_native_size (iface)); | |
236 | ||
237 | result = gssdp_socket_option_set (socket, | |
238 | IPPROTO_IP, | |
239 | IP_ADD_MEMBERSHIP, | |
240 | (char *) &mreq, | |
241 | sizeof (mreq), | |
242 | &inner_error); | |
243 | if (!result) | |
244 | g_propagate_error (error, inner_error); | |
245 | ||
246 | return result; | |
247 | } | |
248 | ||
249 |
0 | /* | |
1 | * Copyright (C) 2010 Jens Georg <mail@jensge.org> | |
2 | * | |
3 | * Author: Jens Georg <mail@jensge.org> | |
4 | * | |
5 | * This library is free software; you can redistribute it and/or | |
6 | * modify it under the terms of the GNU Library General Public | |
7 | * License as published by the Free Software Foundation; either | |
8 | * version 2 of the License, or (at your option) any later version. | |
9 | * | |
10 | * This library is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Library General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Library General Public | |
16 | * License along with this library; if not, write to the | |
17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
18 | * Boston, MA 02111-1307, USA. | |
19 | */ | |
20 | ||
21 | #ifndef __GSSDP_SOCKET_FUNCTIONS_H | |
22 | #define __GSSDP_SOCKET_FUNCTIONS_H | |
23 | ||
24 | #include <gio/gio.h> | |
25 | ||
26 | G_GNUC_INTERNAL gboolean | |
27 | gssdp_socket_enable_loop (GSocket *socket, | |
28 | gboolean enable, | |
29 | GError **error); | |
30 | G_GNUC_INTERNAL gboolean | |
31 | gssdp_socket_set_ttl (GSocket *socket, | |
32 | int ttl, | |
33 | GError **error); | |
34 | G_GNUC_INTERNAL gboolean | |
35 | gssdp_socket_enable_broadcast (GSocket *socket, | |
36 | gboolean enable, | |
37 | GError **error); | |
38 | G_GNUC_INTERNAL gboolean | |
39 | gssdp_socket_mcast_interface_set (GSocket *socket, | |
40 | GInetAddress *iface_address, | |
41 | GError **error); | |
42 | G_GNUC_INTERNAL gboolean | |
43 | gssdp_socket_mcast_group_join (GSocket *socket, | |
44 | GInetAddress *group, | |
45 | GInetAddress *iface, | |
46 | GError **error); | |
47 | #ifdef G_OS_WIN32 | |
48 | G_GNUC_INTERNAL gboolean | |
49 | gssdp_socket_reuse_address (GSocket *socket, | |
50 | gboolean enable, | |
51 | GError **error); | |
52 | #endif | |
53 | #endif |
0 | 0 | /* |
1 | 1 | * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd. |
2 | 2 | * Copyright (C) 2009 Nokia Corporation, all rights reserved. |
3 | * Copyright (C) 2010 Jens Georg <mail@jensge.org> | |
3 | 4 | * |
4 | 5 | * Author: Jorn Baayen <jorn@openedhand.com> |
5 | 6 | * Zeeshan Ali (Khattak) <zeeshanak@gnome.org> |
6 | 7 | * <zeeshan.ali@nokia.com> |
8 | * Jens Georg <mail@jensge.org> | |
7 | 9 | * |
8 | 10 | * This library is free software; you can redistribute it and/or |
9 | 11 | * modify it under the terms of the GNU Library General Public |
23 | 25 | |
24 | 26 | #include <config.h> |
25 | 27 | #include <glib.h> |
26 | #include <sys/socket.h> | |
27 | #include <sys/types.h> | |
28 | #include <netinet/in.h> | |
29 | #include <arpa/inet.h> | |
30 | #include <string.h> | |
31 | #include <stdio.h> | |
32 | #include <errno.h> | |
33 | #include <unistd.h> | |
34 | ||
28 | ||
29 | #include "gssdp-socket-functions.h" | |
35 | 30 | #include "gssdp-socket-source.h" |
36 | 31 | #include "gssdp-protocol.h" |
37 | ||
38 | struct _GSSDPSocketSource { | |
39 | GSource source; | |
40 | ||
41 | GPollFD poll_fd; | |
32 | #include "gssdp-error.h" | |
33 | ||
34 | static void | |
35 | gssdp_socket_source_initable_init (gpointer g_iface, | |
36 | gpointer iface_data); | |
37 | ||
38 | G_DEFINE_TYPE_EXTENDED (GSSDPSocketSource, | |
39 | gssdp_socket_source, | |
40 | G_TYPE_OBJECT, | |
41 | 0, | |
42 | G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, | |
43 | gssdp_socket_source_initable_init)); | |
44 | ||
45 | struct _GSSDPSocketSourcePrivate { | |
46 | GSource *source; | |
47 | GSocket *socket; | |
48 | GSSDPSocketSourceType type; | |
49 | char *host_ip; | |
42 | 50 | }; |
43 | 51 | |
52 | enum { | |
53 | PROP_0, | |
54 | PROP_TYPE, | |
55 | PROP_HOST_IP | |
56 | }; | |
57 | ||
58 | static void | |
59 | gssdp_socket_source_init (GSSDPSocketSource *self) | |
60 | { | |
61 | self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, | |
62 | GSSDP_TYPE_SOCKET_SOURCE, | |
63 | GSSDPSocketSourcePrivate); | |
64 | } | |
65 | ||
44 | 66 | static gboolean |
45 | gssdp_socket_source_prepare (GSource *source, | |
46 | int *timeout); | |
47 | static gboolean | |
48 | gssdp_socket_source_check (GSource *source); | |
49 | static gboolean | |
50 | gssdp_socket_source_dispatch (GSource *source, | |
51 | GSourceFunc callback, | |
52 | gpointer user_data); | |
53 | static void | |
54 | gssdp_socket_source_finalize (GSource *source); | |
55 | ||
56 | static const GSourceFuncs gssdp_socket_source_funcs = { | |
57 | gssdp_socket_source_prepare, | |
58 | gssdp_socket_source_check, | |
59 | gssdp_socket_source_dispatch, | |
60 | gssdp_socket_source_finalize | |
61 | }; | |
67 | gssdp_socket_source_do_init (GInitable *initable, | |
68 | GCancellable *cancellable, | |
69 | GError **error); | |
70 | ||
71 | static void | |
72 | gssdp_socket_source_initable_init (gpointer g_iface, | |
73 | gpointer iface_data) | |
74 | { | |
75 | GInitableIface *iface = (GInitableIface *)g_iface; | |
76 | iface->init = gssdp_socket_source_do_init; | |
77 | } | |
78 | ||
79 | static void | |
80 | gssdp_socket_source_get_property (GObject *object, | |
81 | guint property_id, | |
82 | GValue *value, | |
83 | GParamSpec *pspec) | |
84 | { | |
85 | GSSDPSocketSource *self; | |
86 | ||
87 | self = GSSDP_SOCKET_SOURCE (object); | |
88 | ||
89 | /* All properties are construct-only, write-only */ | |
90 | switch (property_id) { | |
91 | default: | |
92 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); | |
93 | break; | |
94 | } | |
95 | } | |
96 | ||
97 | static void | |
98 | gssdp_socket_source_set_property (GObject *object, | |
99 | guint property_id, | |
100 | const GValue *value, | |
101 | GParamSpec *pspec) | |
102 | { | |
103 | GSSDPSocketSource *self; | |
104 | ||
105 | self = GSSDP_SOCKET_SOURCE (object); | |
106 | ||
107 | switch (property_id) { | |
108 | case PROP_TYPE: | |
109 | self->priv->type = g_value_get_int (value); | |
110 | break; | |
111 | case PROP_HOST_IP: | |
112 | self->priv->host_ip = g_value_dup_string (value); | |
113 | break; | |
114 | default: | |
115 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); | |
116 | break; | |
117 | } | |
118 | } | |
62 | 119 | |
63 | 120 | /** |
64 | 121 | * gssdp_socket_source_new |
67 | 124 | **/ |
68 | 125 | GSSDPSocketSource * |
69 | 126 | gssdp_socket_source_new (GSSDPSocketSourceType type, |
70 | const char *host_ip) | |
71 | { | |
72 | GSource *source; | |
73 | GSSDPSocketSource *socket_source; | |
74 | struct sockaddr_in bind_addr; | |
75 | struct in_addr iface_addr; | |
76 | struct ip_mreq mreq; | |
77 | gboolean boolean = TRUE; | |
78 | guchar ttl = 4; | |
79 | int res; | |
80 | ||
81 | /* Create source */ | |
82 | source = g_source_new ((GSourceFuncs*)&gssdp_socket_source_funcs, | |
83 | sizeof (GSSDPSocketSource)); | |
84 | ||
85 | socket_source = (GSSDPSocketSource *) source; | |
127 | const char *host_ip, | |
128 | GError **error) | |
129 | { | |
130 | return g_initable_new (GSSDP_TYPE_SOCKET_SOURCE, | |
131 | NULL, | |
132 | error, | |
133 | "type", | |
134 | type, | |
135 | "host-ip", | |
136 | host_ip, | |
137 | NULL); | |
138 | } | |
139 | ||
140 | static gboolean | |
141 | gssdp_socket_source_do_init (GInitable *initable, | |
142 | GCancellable *cancellable, | |
143 | GError **error) | |
144 | { | |
145 | GSSDPSocketSource *self = NULL; | |
146 | GInetAddress *iface_address = NULL; | |
147 | GSocketAddress *bind_address = NULL; | |
148 | GInetAddress *group = NULL; | |
149 | GError *inner_error = NULL; | |
150 | GSocketFamily family; | |
151 | ||
152 | self = GSSDP_SOCKET_SOURCE (initable); | |
153 | iface_address = g_inet_address_new_from_string (self->priv->host_ip); | |
154 | if (iface_address == NULL) { | |
155 | if (error != NULL) { | |
156 | *error = g_error_new (GSSDP_ERROR, | |
157 | GSSDP_ERROR_FAILED, | |
158 | "Invalid host ip: %s", | |
159 | self->priv->host_ip); | |
160 | inner_error = *error; | |
161 | } | |
162 | ||
163 | goto error; | |
164 | } | |
165 | ||
166 | family = g_inet_address_get_family (iface_address); | |
167 | ||
168 | if (family == G_SOCKET_FAMILY_IPV4) | |
169 | group = g_inet_address_new_from_string (SSDP_ADDR); | |
170 | else { | |
171 | if (error != NULL) { | |
172 | *error = g_error_new_literal (GSSDP_ERROR, | |
173 | GSSDP_ERROR_FAILED, | |
174 | "IPv6 address"); | |
175 | inner_error = *error; | |
176 | } | |
177 | ||
178 | goto error; | |
179 | } | |
180 | ||
86 | 181 | |
87 | 182 | /* Create socket */ |
88 | socket_source->poll_fd.fd = socket (AF_INET, | |
89 | SOCK_DGRAM, | |
90 | IPPROTO_UDP); | |
91 | if (socket_source->poll_fd.fd == -1) | |
92 | goto error; | |
93 | ||
94 | socket_source->poll_fd.events = G_IO_IN | G_IO_ERR; | |
95 | ||
96 | g_source_add_poll (source, &socket_source->poll_fd); | |
183 | self->priv->socket = g_socket_new (G_SOCKET_FAMILY_IPV4, | |
184 | G_SOCKET_TYPE_DATAGRAM, | |
185 | G_SOCKET_PROTOCOL_UDP, | |
186 | &inner_error); | |
187 | ||
188 | if (!self->priv->socket) { | |
189 | g_propagate_prefixed_error (error, | |
190 | inner_error, | |
191 | "Could not create socket"); | |
192 | ||
193 | goto error; | |
194 | } | |
97 | 195 | |
98 | 196 | /* Enable broadcasting */ |
99 | res = setsockopt (socket_source->poll_fd.fd, | |
100 | SOL_SOCKET, | |
101 | SO_BROADCAST, | |
102 | &boolean, | |
103 | sizeof (boolean)); | |
104 | if (res == -1) | |
105 | goto error; | |
197 | if (!gssdp_socket_enable_broadcast (self->priv->socket, | |
198 | TRUE, | |
199 | &inner_error)) { | |
200 | g_propagate_prefixed_error (error, | |
201 | inner_error, | |
202 | "Failed to enable broadcast"); | |
203 | goto error; | |
204 | } | |
106 | 205 | |
107 | 206 | /* TTL */ |
108 | res = setsockopt (socket_source->poll_fd.fd, | |
109 | IPPROTO_IP, | |
110 | IP_MULTICAST_TTL, | |
111 | &ttl, | |
112 | sizeof (ttl)); | |
113 | if (res == -1) | |
114 | goto error; | |
115 | ||
116 | memset (&bind_addr, 0, sizeof (bind_addr)); | |
117 | bind_addr.sin_family = AF_INET; | |
118 | ||
119 | res = inet_aton (host_ip, &iface_addr); | |
120 | if (res == 0) | |
121 | goto error; | |
122 | ||
207 | if (!gssdp_socket_set_ttl (self->priv->socket, | |
208 | 4, | |
209 | &inner_error)) { | |
210 | g_propagate_prefixed_error (error, | |
211 | inner_error, | |
212 | "Failed to set TTL"); | |
213 | ||
214 | } | |
123 | 215 | /* Set up additional things according to the type of socket desired */ |
124 | if (type == GSSDP_SOCKET_SOURCE_TYPE_MULTICAST) { | |
125 | /* Allow multiple sockets to use the same PORT number */ | |
126 | res = setsockopt (socket_source->poll_fd.fd, | |
127 | SOL_SOCKET, | |
128 | #ifdef SO_REUSEPORT | |
129 | SO_REUSEPORT, | |
216 | if (self->priv->type == GSSDP_SOCKET_SOURCE_TYPE_MULTICAST) { | |
217 | /* Enable multicast loopback */ | |
218 | if (!gssdp_socket_enable_loop (self->priv->socket, | |
219 | TRUE, | |
220 | &inner_error)) { | |
221 | g_propagate_prefixed_error ( | |
222 | error, | |
223 | inner_error, | |
224 | "Failed to enable loop-back"); | |
225 | ||
226 | goto error; | |
227 | } | |
228 | ||
229 | if (!gssdp_socket_mcast_interface_set (self->priv->socket, | |
230 | iface_address, | |
231 | &inner_error)) { | |
232 | g_propagate_prefixed_error ( | |
233 | error, | |
234 | inner_error, | |
235 | "Failed to set multicast interface"); | |
236 | ||
237 | goto error; | |
238 | } | |
239 | ||
240 | #ifdef G_OS_WIN32 | |
241 | bind_address = g_inet_socket_address_new (iface_address, | |
242 | SSDP_PORT); | |
130 | 243 | #else |
131 | SO_REUSEADDR, | |
244 | bind_address = g_inet_socket_address_new (group, | |
245 | SSDP_PORT); | |
132 | 246 | #endif |
133 | &boolean, | |
134 | sizeof (boolean)); | |
135 | if (res == -1) | |
247 | } else { | |
248 | bind_address = g_inet_socket_address_new (iface_address, | |
249 | SSDP_PORT); | |
250 | } | |
251 | ||
252 | #ifdef G_OS_WIN32 | |
253 | /* normally g_socket_bind does this, but it is disabled on | |
254 | * windows since SO_REUSEADDR has different semantics | |
255 | * there. Nevertheless, there's no way without for | |
256 | * multicast sockets | |
257 | */ | |
258 | if (!gssdp_socket_reuse_address (self->priv->socket, | |
259 | TRUE, | |
260 | &inner_error)) { | |
261 | g_propagate_prefixed_error ( | |
262 | error, | |
263 | inner_error, | |
264 | "Failed to enable reuse"); | |
265 | ||
266 | goto error; | |
267 | } | |
268 | #endif | |
269 | /* Bind to requested port and address */ | |
270 | if (!g_socket_bind (self->priv->socket, | |
271 | bind_address, | |
272 | TRUE, | |
273 | &inner_error)) { | |
274 | g_propagate_prefixed_error (error, | |
275 | inner_error, | |
276 | "Failed to bind socket"); | |
277 | ||
278 | goto error; | |
279 | } | |
280 | ||
281 | if (self->priv->type == GSSDP_SOCKET_SOURCE_TYPE_MULTICAST) { | |
282 | ||
283 | /* Subscribe to multicast channel */ | |
284 | if (!gssdp_socket_mcast_group_join (self->priv->socket, | |
285 | group, | |
286 | iface_address, | |
287 | &inner_error)) { | |
288 | char *address = g_inet_address_to_string (group); | |
289 | g_propagate_prefixed_error (error, | |
290 | inner_error, | |
291 | "Failed to join group %s", | |
292 | address); | |
293 | g_free (address); | |
294 | ||
136 | 295 | goto error; |
137 | ||
138 | /* Enable multicast loopback */ | |
139 | res = setsockopt (socket_source->poll_fd.fd, | |
140 | IPPROTO_IP, | |
141 | IP_MULTICAST_LOOP, | |
142 | &boolean, | |
143 | sizeof (boolean)); | |
144 | if (res == -1) | |
145 | goto error; | |
146 | ||
147 | /* Set the interface */ | |
148 | res = setsockopt (socket_source->poll_fd.fd, | |
149 | IPPROTO_IP, | |
150 | IP_MULTICAST_IF, | |
151 | &iface_addr, | |
152 | sizeof (struct in_addr)); | |
153 | if (res == -1) | |
154 | goto error; | |
155 | ||
156 | /* Subscribe to multicast channel */ | |
157 | res = inet_aton (SSDP_ADDR, &(mreq.imr_multiaddr)); | |
158 | if (res == 0) | |
159 | goto error; | |
160 | ||
161 | memcpy (&(mreq.imr_interface), | |
162 | &iface_addr, | |
163 | sizeof (struct in_addr)); | |
164 | ||
165 | res = setsockopt (socket_source->poll_fd.fd, | |
166 | IPPROTO_IP, | |
167 | IP_ADD_MEMBERSHIP, | |
168 | &mreq, | |
169 | sizeof (mreq)); | |
170 | if (res == -1) | |
171 | goto error; | |
172 | ||
173 | bind_addr.sin_port = htons (SSDP_PORT); | |
174 | res = inet_aton (SSDP_ADDR, &(bind_addr.sin_addr)); | |
175 | if (res == 0) | |
176 | goto error; | |
177 | } else { | |
178 | bind_addr.sin_port = 0; | |
179 | memcpy (&(bind_addr.sin_addr), | |
180 | &iface_addr, | |
181 | sizeof (struct in_addr)); | |
182 | } | |
183 | ||
184 | /* Bind to requested port and address */ | |
185 | res = bind (socket_source->poll_fd.fd, | |
186 | (struct sockaddr *) &bind_addr, | |
187 | sizeof (bind_addr)); | |
188 | if (res == -1) | |
189 | goto error; | |
190 | ||
191 | return socket_source; | |
192 | ||
296 | } | |
297 | } | |
298 | ||
299 | self->priv->source = g_socket_create_source (self->priv->socket, | |
300 | G_IO_IN | G_IO_ERR, | |
301 | NULL); | |
193 | 302 | error: |
194 | g_source_destroy (source); | |
195 | ||
196 | return NULL; | |
197 | } | |
198 | ||
199 | static gboolean | |
200 | gssdp_socket_source_prepare (GSource *source, | |
201 | int *timeout) | |
202 | { | |
203 | return FALSE; | |
204 | } | |
205 | ||
206 | static gboolean | |
207 | gssdp_socket_source_check (GSource *source) | |
208 | { | |
209 | GSSDPSocketSource *socket_source; | |
210 | ||
211 | socket_source = (GSSDPSocketSource *) source; | |
212 | ||
213 | return socket_source->poll_fd.revents & (G_IO_IN | G_IO_ERR); | |
214 | } | |
215 | ||
216 | static gboolean | |
217 | gssdp_socket_source_dispatch (GSource *source, | |
218 | GSourceFunc callback, | |
219 | gpointer user_data) | |
220 | { | |
221 | GSSDPSocketSource *socket_source; | |
222 | ||
223 | socket_source = (GSSDPSocketSource *) source; | |
224 | ||
225 | if (socket_source->poll_fd.revents & G_IO_IN) { | |
226 | /* Ready to read */ | |
227 | if (callback) | |
228 | callback (user_data); | |
229 | } else if (socket_source->poll_fd.revents & G_IO_ERR) { | |
230 | /* Error */ | |
231 | int value; | |
232 | socklen_t size_int; | |
233 | ||
234 | value = EINVAL; | |
235 | size_int = sizeof (int); | |
236 | ||
237 | /* Get errno from socket */ | |
238 | getsockopt (socket_source->poll_fd.fd, | |
239 | SOL_SOCKET, | |
240 | SO_ERROR, | |
241 | &value, | |
242 | &size_int); | |
243 | ||
244 | g_warning ("Socket error %d received: %s", | |
245 | value, | |
246 | strerror (value)); | |
303 | if (iface_address != NULL) | |
304 | g_object_unref (iface_address); | |
305 | if (bind_address != NULL) | |
306 | g_object_unref (bind_address); | |
307 | if (group != NULL) | |
308 | g_object_unref (group); | |
309 | if (inner_error != NULL) { | |
310 | if (error == NULL) { | |
311 | g_warning ("Failed to create socket source: %s", | |
312 | inner_error->message); | |
313 | g_error_free (inner_error); | |
314 | } | |
315 | ||
316 | return FALSE; | |
247 | 317 | } |
248 | 318 | |
249 | 319 | return TRUE; |
250 | 320 | } |
251 | 321 | |
252 | static void | |
253 | gssdp_socket_source_finalize (GSource *source) | |
254 | { | |
255 | GSSDPSocketSource *socket_source; | |
256 | ||
257 | socket_source = (GSSDPSocketSource *) source; | |
258 | ||
259 | /* Close the socket */ | |
260 | close (socket_source->poll_fd.fd); | |
261 | } | |
262 | ||
263 | /** | |
264 | * gssdp_socket_source_get_fd | |
265 | * | |
266 | * Return value: The socket's FD. | |
267 | **/ | |
268 | int | |
269 | gssdp_socket_source_get_fd (GSSDPSocketSource *socket_source) | |
270 | { | |
271 | g_return_val_if_fail (socket_source != NULL, -1); | |
272 | ||
273 | return socket_source->poll_fd.fd; | |
274 | } | |
322 | GSocket * | |
323 | gssdp_socket_source_get_socket (GSSDPSocketSource *socket_source) | |
324 | { | |
325 | g_return_val_if_fail (socket_source != NULL, NULL); | |
326 | ||
327 | return socket_source->priv->socket; | |
328 | } | |
329 | ||
330 | void | |
331 | gssdp_socket_source_set_callback (GSSDPSocketSource *self, | |
332 | GSourceFunc callback, | |
333 | gpointer user_data) | |
334 | { | |
335 | g_return_if_fail (self != NULL); | |
336 | g_return_if_fail (GSSDP_IS_SOCKET_SOURCE (self)); | |
337 | ||
338 | g_source_set_callback (self->priv->source, callback, user_data, NULL); | |
339 | } | |
340 | ||
341 | void | |
342 | gssdp_socket_source_attach (GSSDPSocketSource *self, | |
343 | GMainContext *context) | |
344 | { | |
345 | g_return_if_fail (self != NULL); | |
346 | g_return_if_fail (GSSDP_IS_SOCKET_SOURCE (self)); | |
347 | ||
348 | g_source_attach (self->priv->source, context); | |
349 | } | |
350 | ||
351 | static void | |
352 | gssdp_socket_source_dispose (GObject *object) | |
353 | { | |
354 | GSSDPSocketSource *self; | |
355 | ||
356 | self = GSSDP_SOCKET_SOURCE (object); | |
357 | ||
358 | if (self->priv->source != NULL) { | |
359 | g_source_unref (self->priv->source); | |
360 | g_source_destroy (self->priv->source); | |
361 | self->priv->source = NULL; | |
362 | } | |
363 | ||
364 | if (self->priv->socket != NULL) { | |
365 | g_socket_close (self->priv->socket, NULL); | |
366 | g_object_unref (self->priv->socket); | |
367 | self->priv->socket = NULL; | |
368 | } | |
369 | ||
370 | G_OBJECT_CLASS (gssdp_socket_source_parent_class)->dispose (object); | |
371 | } | |
372 | ||
373 | static void | |
374 | gssdp_socket_source_finalize (GObject *object) | |
375 | { | |
376 | GSSDPSocketSource *self; | |
377 | ||
378 | self = GSSDP_SOCKET_SOURCE (object); | |
379 | ||
380 | if (self->priv->host_ip != NULL) { | |
381 | g_free (self->priv->host_ip); | |
382 | self->priv->host_ip = NULL; | |
383 | } | |
384 | ||
385 | G_OBJECT_CLASS (gssdp_socket_source_parent_class)->finalize (object); | |
386 | } | |
387 | ||
388 | static void | |
389 | gssdp_socket_source_class_init (GSSDPSocketSourceClass *klass) | |
390 | { | |
391 | GObjectClass *object_class; | |
392 | ||
393 | object_class = G_OBJECT_CLASS (klass); | |
394 | ||
395 | object_class->get_property = gssdp_socket_source_get_property; | |
396 | object_class->set_property = gssdp_socket_source_set_property; | |
397 | object_class->dispose = gssdp_socket_source_dispose; | |
398 | object_class->finalize = gssdp_socket_source_finalize; | |
399 | ||
400 | g_type_class_add_private (klass, sizeof (GSSDPSocketSourcePrivate)); | |
401 | ||
402 | g_object_class_install_property | |
403 | (object_class, | |
404 | PROP_TYPE, | |
405 | g_param_spec_int | |
406 | ("type", | |
407 | "Type", | |
408 | "Type of socket-source (Multicast/Unicast)", | |
409 | GSSDP_SOCKET_SOURCE_TYPE_REQUEST, | |
410 | GSSDP_SOCKET_SOURCE_TYPE_MULTICAST, | |
411 | GSSDP_SOCKET_SOURCE_TYPE_REQUEST, | |
412 | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | | |
413 | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | | |
414 | G_PARAM_STATIC_BLURB)); | |
415 | ||
416 | g_object_class_install_property | |
417 | (object_class, | |
418 | PROP_HOST_IP, | |
419 | g_param_spec_string | |
420 | ("host-ip", | |
421 | "Host ip", | |
422 | "IP address of associated network interface", | |
423 | NULL, | |
424 | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | | |
425 | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | | |
426 | G_PARAM_STATIC_BLURB)); | |
427 | } |
0 | 0 | /* |
1 | 1 | * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd. |
2 | * Copyright (C) 2010 Jens Georg <mail@jensge.org> | |
2 | 3 | * |
3 | 4 | * Author: Jorn Baayen <jorn@openedhand.com> |
5 | * Jens Georg <mail@jensge.org> | |
4 | 6 | * |
5 | 7 | * This library is free software; you can redistribute it and/or |
6 | 8 | * modify it under the terms of the GNU Library General Public |
21 | 23 | #ifndef __GSSDP_SOCKET_SOURCE_H__ |
22 | 24 | #define __GSSDP_SOCKET_SOURCE_H__ |
23 | 25 | |
26 | #include <glib-object.h> | |
27 | ||
28 | #include <gio/gio.h> | |
29 | ||
24 | 30 | G_BEGIN_DECLS |
25 | 31 | |
26 | typedef struct _GSSDPSocketSource GSSDPSocketSource; | |
32 | #define GSSDP_TYPE_SOCKET_SOURCE \ | |
33 | (gssdp_socket_source_get_type ()) | |
34 | #define GSSDP_SOCKET_SOURCE(obj) \ | |
35 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ | |
36 | GSSDP_TYPE_SOCKET_SOURCE, \ | |
37 | GSSDPSocketSource)) | |
38 | #define GSSDP_SOCKET_SOURCE_CLASS(klass) \ | |
39 | (G_TYPE_CHECK_CLASS_CAST ((klass), \ | |
40 | GSSDP_TYPE_SOCKET_SOURCE, \ | |
41 | GSSDPSocketSourceClass)) | |
42 | #define GSSDP_IS_SOCKET_SOURCE(obj) \ | |
43 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ | |
44 | GSSDP_TYPE_SOCKET_SOURCE)) | |
45 | #define GSSDP_IS_SOCKET_SOURCE_CLASS(klass) \ | |
46 | (G_TYPE_CHECK_CLASS_TYPE ((klass), \ | |
47 | GSSDP_TYPE_SOCKET_SOURCE)) | |
48 | #define GSSDP_SOCKET_SOURCE_GET_CLASS(obj) \ | |
49 | (G_TYPE_INSTANCE_GET_CLASS ((obj), \ | |
50 | GSSDP_TYPE_SOCKET_SOURCE, \ | |
51 | GSSDPSocketSourceClass)) | |
52 | ||
53 | typedef struct _GSSDPSocketSourcePrivate GSSDPSocketSourcePrivate; | |
27 | 54 | |
28 | 55 | typedef enum { |
29 | 56 | GSSDP_SOCKET_SOURCE_TYPE_REQUEST, |
30 | 57 | GSSDP_SOCKET_SOURCE_TYPE_MULTICAST |
31 | 58 | } GSSDPSocketSourceType; |
32 | 59 | |
60 | ||
61 | ||
62 | typedef struct _GSSDPSocketSource { | |
63 | GObject parent; | |
64 | ||
65 | GSSDPSocketSourcePrivate *priv; | |
66 | } GSSDPSocketSource; | |
67 | ||
68 | typedef struct _GSSDPSocketSourceClass { | |
69 | GObjectClass parent_class; | |
70 | } GSSDPSocketSourceClass; | |
71 | ||
33 | 72 | G_GNUC_INTERNAL GSSDPSocketSource * |
34 | gssdp_socket_source_new (GSSDPSocketSourceType type, | |
35 | const char *host_ip); | |
73 | gssdp_socket_source_new (GSSDPSocketSourceType type, | |
74 | const char *host_ip, | |
75 | GError **error); | |
76 | G_GNUC_INTERNAL GSocket* | |
77 | gssdp_socket_source_get_socket (GSSDPSocketSource *socket_source); | |
36 | 78 | |
37 | G_GNUC_INTERNAL int | |
38 | gssdp_socket_source_get_fd (GSSDPSocketSource *socket_source); | |
79 | G_GNUC_INTERNAL void | |
80 | gssdp_socket_source_set_callback (GSSDPSocketSource *socket_source, | |
81 | GSourceFunc callback, | |
82 | gpointer user_data); | |
83 | ||
84 | G_GNUC_INTERNAL void | |
85 | gssdp_socket_source_attach (GSSDPSocketSource *socket_source, | |
86 | GMainContext *context); | |
39 | 87 | |
40 | 88 | G_END_DECLS |
41 | 89 |