Codebase list gssdp / 2600dbe
Imported Upstream version 0.10.0 Andreas Henriksson 13 years ago
36 changed file(s) with 1933 addition(s) and 2109 deletion(s). Raw diff Collapse all Expand all
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.
+60
-21
NEWS less more
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.
457
558 All Contributors:
659
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>
2463
2564 0.8.0
2665 =====
00 #! /bin/sh
11 # 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.
33 #
44 # Report bugs to <http://www.gupnp.org/>.
55 #
700700 # Identity of this package.
701701 PACKAGE_NAME='gssdp'
702702 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'
705705 PACKAGE_BUGREPORT='http://www.gupnp.org/'
706706 PACKAGE_URL=''
707707
760760 GTKDOC_MKPDF
761761 GTKDOC_REBASE
762762 GTKDOC_CHECK
763 OS_WIN32_FALSE
764 OS_WIN32_TRUE
763765 HAVE_INTROSPECTION_FALSE
764766 HAVE_INTROSPECTION_TRUE
765767 INTROSPECTION_MAKEFILE
14611463 # Omit some internal or obsolete options to make the list less imposing.
14621464 # This message is too long to be a string in the A/UX 3.1 sh.
14631465 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.
14651467
14661468 Usage: $0 [OPTION]... [VAR=VALUE]...
14671469
15311533
15321534 if test -n "$ac_init_help"; then
15331535 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:";;
15351537 esac
15361538 cat <<\_ACEOF
15371539
16481650 test -n "$ac_init_help" && exit $ac_status
16491651 if $ac_init_version; then
16501652 cat <<\_ACEOF
1651 gssdp configure 0.8.2
1653 gssdp configure 0.10.0
16521654 generated by GNU Autoconf 2.67
16531655
16541656 Copyright (C) 2010 Free Software Foundation, Inc.
19261928 This file contains any messages produced by compilers while
19271929 running configure, to aid debugging if configure makes a mistake.
19281930
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
19301932 generated by GNU Autoconf 2.67. Invocation command line was
19311933
19321934 $ $0 $@
27412743
27422744 # Define the identity of the package.
27432745 PACKAGE='gssdp'
2744 VERSION='0.8.2'
2746 VERSION='0.10.0'
27452747
27462748
27472749 cat >>confdefs.h <<_ACEOF
54315433 else
54325434 lt_cv_nm_interface="BSD nm"
54335435 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)
54355437 (eval "$ac_compile" 2>conftest.err)
54365438 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)
54385440 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
54395441 cat conftest.err >&5
5440 (eval echo "\"\$as_me:5441: output\"" >&5)
5442 (eval echo "\"\$as_me:5443: output\"" >&5)
54415443 cat conftest.out >&5
54425444 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
54435445 lt_cv_nm_interface="MS dumpbin"
66426644 ;;
66436645 *-*-irix6*)
66446646 # Find out which ABI we are using.
6645 echo '#line 6646 "configure"' > conftest.$ac_ext
6647 echo '#line 6648 "configure"' > conftest.$ac_ext
66466648 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
66476649 (eval $ac_compile) 2>&5
66486650 ac_status=$?
79177919 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
79187920 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
79197921 -e 's:$: $lt_compiler_flag:'`
7920 (eval echo "\"\$as_me:7921: $lt_compile\"" >&5)
7922 (eval echo "\"\$as_me:7923: $lt_compile\"" >&5)
79217923 (eval "$lt_compile" 2>conftest.err)
79227924 ac_status=$?
79237925 cat conftest.err >&5
7924 echo "$as_me:7925: \$? = $ac_status" >&5
7926 echo "$as_me:7927: \$? = $ac_status" >&5
79257927 if (exit $ac_status) && test -s "$ac_outfile"; then
79267928 # The compiler can only warn and ignore the option if not recognized
79277929 # So say no if there are warnings other than the usual output.
82568258 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
82578259 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
82588260 -e 's:$: $lt_compiler_flag:'`
8259 (eval echo "\"\$as_me:8260: $lt_compile\"" >&5)
8261 (eval echo "\"\$as_me:8262: $lt_compile\"" >&5)
82608262 (eval "$lt_compile" 2>conftest.err)
82618263 ac_status=$?
82628264 cat conftest.err >&5
8263 echo "$as_me:8264: \$? = $ac_status" >&5
8265 echo "$as_me:8266: \$? = $ac_status" >&5
82648266 if (exit $ac_status) && test -s "$ac_outfile"; then
82658267 # The compiler can only warn and ignore the option if not recognized
82668268 # So say no if there are warnings other than the usual output.
83618363 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
83628364 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
83638365 -e 's:$: $lt_compiler_flag:'`
8364 (eval echo "\"\$as_me:8365: $lt_compile\"" >&5)
8366 (eval echo "\"\$as_me:8367: $lt_compile\"" >&5)
83658367 (eval "$lt_compile" 2>out/conftest.err)
83668368 ac_status=$?
83678369 cat out/conftest.err >&5
8368 echo "$as_me:8369: \$? = $ac_status" >&5
8370 echo "$as_me:8371: \$? = $ac_status" >&5
83698371 if (exit $ac_status) && test -s out/conftest2.$ac_objext
83708372 then
83718373 # The compiler can only warn and ignore the option if not recognized
84168418 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
84178419 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
84188420 -e 's:$: $lt_compiler_flag:'`
8419 (eval echo "\"\$as_me:8420: $lt_compile\"" >&5)
8421 (eval echo "\"\$as_me:8422: $lt_compile\"" >&5)
84208422 (eval "$lt_compile" 2>out/conftest.err)
84218423 ac_status=$?
84228424 cat out/conftest.err >&5
8423 echo "$as_me:8424: \$? = $ac_status" >&5
8425 echo "$as_me:8426: \$? = $ac_status" >&5
84248426 if (exit $ac_status) && test -s out/conftest2.$ac_objext
84258427 then
84268428 # The compiler can only warn and ignore the option if not recognized
1080010802 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1080110803 lt_status=$lt_dlunknown
1080210804 cat > conftest.$ac_ext <<_LT_EOF
10803 #line 10804 "configure"
10805 #line 10806 "configure"
1080410806 #include "confdefs.h"
1080510807
1080610808 #if HAVE_DLFCN_H
1089610898 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1089710899 lt_status=$lt_dlunknown
1089810900 cat > conftest.$ac_ext <<_LT_EOF
10899 #line 10900 "configure"
10901 #line 10902 "configure"
1090010902 #include "confdefs.h"
1090110903
1090210904 #if HAVE_DLFCN_H
1125011252 pkg_cv_LIBGSSDP_CFLAGS="$LIBGSSDP_CFLAGS"
1125111253 elif test -n "$PKG_CONFIG"; then
1125211254 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
1125911263 ac_status=$?
1126011264 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1126111265 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`
1126511270 else
1126611271 pkg_failed=yes
1126711272 fi
1127211277 pkg_cv_LIBGSSDP_LIBS="$LIBGSSDP_LIBS"
1127311278 elif test -n "$PKG_CONFIG"; then
1127411279 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
1128111288 ac_status=$?
1128211289 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1128311290 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`
1128711295 else
1128811296 pkg_failed=yes
1128911297 fi
1130111309 _pkg_short_errors_supported=no
1130211310 fi
1130311311 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`
1130711316 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`
1131111321 fi
1131211322 # Put the nasty error message in config.log where it belongs
1131311323 echo "$LIBGSSDP_PKG_ERRORS" >&5
1131411324
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:
1131811329
1131911330 $LIBGSSDP_PKG_ERRORS
1132011331
1157011581 fi
1157111582
1157211583
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
1157311604
1157411605
1157511606
1192611957 fi
1192711958 if test -z "${HAVE_INTROSPECTION_TRUE}" && test -z "${HAVE_INTROSPECTION_FALSE}"; then
1192811959 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.
1192911964 Usually this means the macro was only invoked conditionally." "$LINENO" 5
1193011965 fi
1193111966 if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then
1235612391 # report actual input values of CONFIG_FILES etc. instead of their
1235712392 # values after options handling.
1235812393 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
1236012395 generated by GNU Autoconf 2.67. Invocation command line was
1236112396
1236212397 CONFIG_FILES = $CONFIG_FILES
1242212457 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1242312458 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1242412459 ac_cs_version="\\
12425 gssdp config.status 0.8.2
12460 gssdp config.status 0.10.0
1242612461 configured by $0, generated by GNU Autoconf 2.67,
1242712462 with options \\"\$ac_cs_config\\"
1242812463
00 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/)
22 AM_INIT_AUTOMAKE()
33 AC_CONFIG_SRCDIR(libgssdp/gssdp-client.c)
44 AM_CONFIG_HEADER(config.h)
1111 AC_PROG_LIBTOOL
1212 AC_CONFIG_MACRO_DIR([m4])
1313
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)
1718
1819 LIBGTK_REQUIRED=2.12.0
1920
6162 fi
6263
6364 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])
6477
6578 GTK_DOC_CHECK([1.0])
6679
277277 #
278278 GPATH = $(srcdir)
279279 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
280286
281287 # This includes the standard gtk-doc make rules, copied by gtkdocize.
282288
283289 # Other files to distribute
284290 # 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
292295
293296 SCANOBJ_FILES = \
294297 $(DOC_MODULE).args \
509512
510513 $(REPORT_FILES): sgml-build.stamp
511514
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
512535 #### scan ####
513536
514537 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
515538 @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 \
518541 _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) ; \
524546 else \
525 cd $(srcdir) ; \
526547 for i in $(SCANOBJ_FILES) ; do \
527548 test -f $$i || touch $$i ; \
528549 done \
534555
535556 #### templates ####
536557
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
538559 @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
541566 @touch tmpl-build.stamp
542567
543568 tmpl.stamp: tmpl-build.stamp
551576 sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
552577 @echo 'gtk-doc: Building XML'
553578 @-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 \
555581 _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)
559584 @touch sgml-build.stamp
560585
561586 sgml.stamp: sgml-build.stamp
565590
566591 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
567592 @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
571595 @mkhtml_options=""; \
572596 gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
573597 if test "$(?)" = "0"; then \
574 mkhtml_options=--path="$(srcdir)"; \
598 mkhtml_options=--path="$(abs_srcdir)"; \
575599 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;
578610 @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)
580612 @touch html-build.stamp
581613
582614 #### pdf ####
583615
584616 pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
585617 @echo 'gtk-doc: Building PDF'
586 @-chmod -R u+w $(srcdir)
587 @rm -rf $(srcdir)/$(DOC_MODULE).pdf
618 @rm -rf $(DOC_MODULE).pdf
588619 @mkpdf_imgdirs=""; \
589620 if test "x$(HTML_IMAGES)" != "x"; then \
590621 for img in $(HTML_IMAGES); do \
595626 fi; \
596627 done; \
597628 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)
599630 @touch pdf-build.stamp
600631
601632 ##############
605636 rm -rf .libs
606637
607638 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
611645
612646 maintainer-clean-local: clean
613 cd $(srcdir) && rm -rf xml html
647 rm -rf xml html
614648
615649 install-data-local:
616650 @installfiles=`echo $(srcdir)/html/*`; \
655689 dist-hook: dist-check-gtkdoc dist-hook-local
656690 mkdir $(distdir)/tmpl
657691 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)/
663697 cd $(distdir) && rm -f $(DISTCLEANFILES)
664698 $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
665699
77 gssdp_client_get_server_id
88 gssdp_client_get_interface
99 gssdp_client_get_host_ip
10 gssdp_client_set_network
11 gssdp_client_get_network
1012 gssdp_client_get_active
1113 <SUBSECTION Standard>
1214 GSSDP_CLIENT
+0
-5
doc/gssdp.types less more
0 #include <libgssdp/gssdp.h>
1
2 gssdp_client_get_type
3 gssdp_resource_browser_get_type
4 gssdp_resource_group_get_type
77 <link rel="up" href="ch01.html" title="GSSDP">
88 <link rel="prev" href="ch01.html" title="GSSDP">
99 <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)">
1111 <link rel="stylesheet" href="style.css" type="text/css">
1212 </head>
1313 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
4444 <a name="GSSDPClient.synopsis"></a><h2>Synopsis</h2>
4545 <pre class="synopsis"> <a class="link" href="GSSDPClient.html#GSSDPClient-struct" title="GSSDPClient">GSSDPClient</a>;
4646 <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>,
4848 <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>);
4949 <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>);
5050 <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>,
5252 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>);
5353 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>);
5454 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>);
5558 <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>);
5659 </pre>
5760 </div>
7073 "<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
7174 "<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
7275 "<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
7377 "<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
7478 </pre>
7579 </div>
8589 <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>
8690 and <a class="link" href="GSSDPResourceGroup.html" title="GSSDPResourceGroup"><span class="type">GSSDPResourceGroup</span></a>.
8791 </p>
88 <p>
89 </p>
9092 </div>
9193 <div class="refsect1">
9294 <a name="GSSDPClient.details"></a><h2>Details</h2>
100102 <div class="refsect2">
101103 <a name="gssdp-client-new"></a><h3>gssdp_client_new ()</h3>
102104 <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>,
104106 <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>
107107 <div class="variablelist"><table border="0">
108108 <col align="left" valign="top">
109109 <tbody>
110110 <tr>
111111 <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>
119113 </tr>
120114 <tr>
121115 <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>
129121 </tr>
130122 </tbody>
131123 </table></div>
134126 <div class="refsect2">
135127 <a name="gssdp-client-get-main-context"></a><h3>gssdp_client_get_main_context ()</h3>
136128 <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>
151140 </tr>
152141 </tbody>
153142 </table></div>
160149 <p>
161150 Sets the server ID of <em class="parameter"><code>client</code></em> to <em class="parameter"><code>server_id</code></em>.
162151 </p>
163 <p>
164 </p>
165152 <div class="variablelist"><table border="0">
166153 <col align="left" valign="top">
167154 <tbody>
172159 </tr>
173160 <tr>
174161 <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>
177163 </tr>
178164 </tbody>
179165 </table></div>
182168 <div class="refsect2">
183169 <a name="gssdp-client-get-server-id"></a><h3>gssdp_client_get_server_id ()</h3>
184170 <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>
199182 </tr>
200183 </tbody>
201184 </table></div>
207190 <p>
208191 Get the name of the network interface associated to <em class="parameter"><code>client</code></em>.
209192 </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>
224204 </tr>
225205 </tbody>
226206 </table></div>
232212 <p>
233213 Get the IP address we advertise ourselves as using.
234214 </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>
249271 </tr>
250272 </tbody>
251273 </table></div>
254276 <div class="refsect2">
255277 <a name="gssdp-client-get-active"></a><h3>gssdp_client_get_active ()</h3>
256278 <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>
271291 </tr>
272292 </tbody>
273293 </table></div>
283303 (default), the client sends messages on the network, otherwise
284304 not. In most cases, you don't want to touch this property.
285305 </p>
286 <p>
287 </p>
288306 <p>Default value: TRUE</p>
289307 </div>
290308 <hr>
294312 <p>
295313 Internal property.
296314 </p>
297 <p>
298 </p>
299315 <p class="stability">Stability Level: Private</p>
300316 </div>
301317 <hr>
305321 <p>
306322 The IP address of the assoicated network interface.
307323 </p>
308 <p>
309 </p>
310324 <p>Default value: NULL</p>
311325 </div>
312326 <hr>
317331 The name of the network interface this client is associated with.
318332 Set to NULL to autodetect.
319333 </p>
320 <p>
321 </p>
322334 <p>Default value: NULL</p>
323335 </div>
324336 <hr>
328340 <p>
329341 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.
330342 </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>
333357 </div>
334358 <hr>
335359 <div class="refsect2">
337361 <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>
338362 <p>
339363 The SSDP server's identifier.
340 </p>
341 <p>
342364 </p>
343365 <p>Default value: NULL</p>
344366 </div>
356378 <p>
357379 Internal signal.
358380 </p>
359 <p>
360 </p>
361381 <div class="variablelist"><table border="0">
362382 <col align="left" valign="top">
363383 <tbody><tr>
371391 </div>
372392 <div class="footer">
373393 <hr>
374 Generated by GTK-Doc V1.15.1</div>
394 Generated by GTK-Doc V1.17.1</div>
375395 </body>
376396 </html>
77 <link rel="up" href="ch01.html" title="GSSDP">
88 <link rel="prev" href="GSSDPClient.html" title="GSSDPClient">
99 <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)">
1111 <link rel="stylesheet" href="style.css" type="text/css">
1212 </head>
1313 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
9090 specified discovery target changes. A discovery request is sent out
9191 automatically when activating the browser.
9292 </p>
93 <p>
94 </p>
9593 </div>
9694 <div class="refsect1">
9795 <a name="GSSDPResourceBrowser.details"></a><h2>Details</h2>
108106 </pre>
109107 <p>
110108 SSDP search target for finding all possible resources.
111 </p>
112 <p>
113109 </p>
114110 </div>
115111 <hr>
117113 <a name="gssdp-resource-browser-new"></a><h3>gssdp_resource_browser_new ()</h3>
118114 <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>,
119115 <em class="parameter"><code>const <span class="type">char</span> *target</code></em>);</pre>
120 <p>
121 </p>
122116 <div class="variablelist"><table border="0">
123117 <col align="left" valign="top">
124118 <tbody>
125119 <tr>
126120 <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>
139126 </tr>
140127 </tbody>
141128 </table></div>
144131 <div class="refsect2">
145132 <a name="gssdp-resource-browser-get-client"></a><h3>gssdp_resource_browser_get_client ()</h3>
146133 <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>
161145 </tr>
162146 </tbody>
163147 </table></div>
170154 <p>
171155 Sets the browser target of <em class="parameter"><code>resource_browser</code></em> to <em class="parameter"><code>target</code></em>.
172156 </p>
173 <p>
174 </p>
175157 <div class="variablelist"><table border="0">
176158 <col align="left" valign="top">
177159 <tbody>
182164 </tr>
183165 <tr>
184166 <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>
187168 </tr>
188169 </tbody>
189170 </table></div>
192173 <div class="refsect2">
193174 <a name="gssdp-resource-browser-get-target"></a><h3>gssdp_resource_browser_get_target ()</h3>
194175 <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>
209187 </tr>
210188 </tbody>
211189 </table></div>
218196 <p>
219197 Sets the used MX value of <em class="parameter"><code>resource_browser</code></em> to <em class="parameter"><code>mx</code></em>.
220198 </p>
221 <p>
222 </p>
223199 <div class="variablelist"><table border="0">
224200 <col align="left" valign="top">
225201 <tbody>
230206 </tr>
231207 <tr>
232208 <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>
235210 </tr>
236211 </tbody>
237212 </table></div>
240215 <div class="refsect2">
241216 <a name="gssdp-resource-browser-get-mx"></a><h3>gssdp_resource_browser_get_mx ()</h3>
242217 <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>
257229 </tr>
258230 </tbody>
259231 </table></div>
266238 <p>
267239 (De)activates <em class="parameter"><code>resource_browser</code></em>.
268240 </p>
269 <p>
270 </p>
271241 <div class="variablelist"><table border="0">
272242 <col align="left" valign="top">
273243 <tbody>
288258 <div class="refsect2">
289259 <a name="gssdp-resource-browser-get-active"></a><h3>gssdp_resource_browser_get_active ()</h3>
290260 <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>
305272 </tr>
306273 </tbody>
307274 </table></div>
315282 <p>
316283 Whether this browser is active or not.
317284 </p>
318 <p>
319 </p>
320285 <p>Default value: FALSE</p>
321286 </div>
322287 <hr>
326291 <p>
327292 The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> to use.
328293 </p>
329 <p>
330 </p>
331294 </div>
332295 <hr>
333296 <div class="refsect2">
337300 The maximum number of seconds in which to request other parties
338301 to respond.
339302 </p>
340 <p>
341 </p>
342303 <p>Allowed values: [1,65535]</p>
343304 <p>Default value: 3</p>
344305 </div>
348309 <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>
349310 <p>
350311 The discovery target.
351 </p>
352 <p>
353312 </p>
354313 <p>Default value: NULL</p>
355314 </div>
366325 The ::resource-available signal is emitted whenever a new resource
367326 has become available.
368327 </p>
369 <p>
370 </p>
371328 <div class="variablelist"><table border="0">
372329 <col align="left" valign="top">
373330 <tbody>
374331 <tr>
375332 <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td>
376333 <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>
379335 </tr>
380336 <tr>
381337 <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>
384339 </tr>
385340 <tr>
386341 <td><p><span class="term"><em class="parameter"><code>locations</code></em> :</span></p></td>
387342 <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>
390344 </tr>
391345 <tr>
392346 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
405359 The ::resource-unavailable signal is emitted whenever a resource
406360 is not available any more.
407361 </p>
408 <p>
409 </p>
410362 <div class="variablelist"><table border="0">
411363 <col align="left" valign="top">
412364 <tbody>
413365 <tr>
414366 <td><p><span class="term"><em class="parameter"><code>resource_browser</code></em> :</span></p></td>
415367 <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>
418369 </tr>
419370 <tr>
420371 <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>
423373 </tr>
424374 <tr>
425375 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
432382 </div>
433383 <div class="footer">
434384 <hr>
435 Generated by GTK-Doc V1.15.1</div>
385 Generated by GTK-Doc V1.17.1</div>
436386 </body>
437387 </html>
77 <link rel="up" href="ch01.html" title="GSSDP">
88 <link rel="prev" href="GSSDPResourceBrowser.html" title="GSSDPResourceBrowser">
99 <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)">
1111 <link rel="stylesheet" href="style.css" type="text/css">
1212 </head>
1313 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
9191 be controlled as one. This is useful when one needs to announce a single
9292 service as multiple SSDP resources (UPnP does this for example).
9393 </p>
94 <p>
95 </p>
9694 </div>
9795 <div class="refsect1">
9896 <a name="GSSDPResourceGroup.details"></a><h2>Details</h2>
106104 <div class="refsect2">
107105 <a name="gssdp-resource-group-new"></a><h3>gssdp_resource_group_new ()</h3>
108106 <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>
111107 <div class="variablelist"><table border="0">
112108 <col align="left" valign="top">
113109 <tbody>
114110 <tr>
115111 <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>
123117 </tr>
124118 </tbody>
125119 </table></div>
128122 <div class="refsect2">
129123 <a name="gssdp-resource-group-get-client"></a><h3>gssdp_resource_group_get_client ()</h3>
130124 <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>
145136 </tr>
146137 </tbody>
147138 </table></div>
154145 <p>
155146 Sets the number of seconds advertisements are valid to <em class="parameter"><code>max_age</code></em>.
156147 </p>
157 <p>
158 </p>
159148 <div class="variablelist"><table border="0">
160149 <col align="left" valign="top">
161150 <tbody>
166155 </tr>
167156 <tr>
168157 <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>
171159 </tr>
172160 </tbody>
173161 </table></div>
176164 <div class="refsect2">
177165 <a name="gssdp-resource-group-get-max-age"></a><h3>gssdp_resource_group_get_max_age ()</h3>
178166 <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>
193178 </tr>
194179 </tbody>
195180 </table></div>
204189 <em class="parameter"><code>resource_group</code></em>s availability causes it to announce its new state
205190 to listening SSDP clients.
206191 </p>
207 <p>
208 </p>
209192 <div class="variablelist"><table border="0">
210193 <col align="left" valign="top">
211194 <tbody>
216199 </tr>
217200 <tr>
218201 <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>
221203 </tr>
222204 </tbody>
223205 </table></div>
226208 <div class="refsect2">
227209 <a name="gssdp-resource-group-get-available"></a><h3>gssdp_resource_group_get_available ()</h3>
228210 <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>
243222 </tr>
244223 </tbody>
245224 </table></div>
253232 <p>
254233 Sets the minimum time between each SSDP message.
255234 </p>
256 <p>
257 </p>
258235 <div class="variablelist"><table border="0">
259236 <col align="left" valign="top">
260237 <tbody>
265242 </tr>
266243 <tr>
267244 <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>
270246 </tr>
271247 </tbody>
272248 </table></div>
276252 <a name="gssdp-resource-group-get-message-delay"></a><h3>gssdp_resource_group_get_message_delay ()</h3>
277253 <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
278254 (<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>
293266 </tr>
294267 </tbody>
295268 </table></div>
305278 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>
306279 to <em class="parameter"><code>resource_group</code></em>.
307280 </p>
308 <p>
309 </p>
310281 <div class="variablelist"><table border="0">
311282 <col align="left" valign="top">
312283 <tbody>
317288 </tr>
318289 <tr>
319290 <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>
322292 </tr>
323293 <tr>
324294 <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>
327296 </tr>
328297 <tr>
329298 <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>
337304 </tr>
338305 </tbody>
339306 </table></div>
350317 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>
351318 to <em class="parameter"><code>resource_group</code></em>.
352319 </p>
353 <p>
354 </p>
355320 <div class="variablelist"><table border="0">
356321 <col align="left" valign="top">
357322 <tbody>
362327 </tr>
363328 <tr>
364329 <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>
367331 </tr>
368332 <tr>
369333 <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>
372335 </tr>
373336 <tr>
374337 <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>
382343 </tr>
383344 </tbody>
384345 </table></div>
392353 <p>
393354 Removes the resource with ID <em class="parameter"><code>resource_id</code></em> from <em class="parameter"><code>resource_group</code></em>.
394355 </p>
395 <p>
396 </p>
397356 <div class="variablelist"><table border="0">
398357 <col align="left" valign="top">
399358 <tbody>
404363 </tr>
405364 <tr>
406365 <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>
409367 </tr>
410368 </tbody>
411369 </table></div>
419377 <p>
420378 Whether this group of resources is available or not.
421379 </p>
422 <p>
423 </p>
424380 <p>Default value: FALSE</p>
425381 </div>
426382 <hr>
430386 <p>
431387 The <a class="link" href="GSSDPClient.html" title="GSSDPClient"><span class="type">GSSDPClient</span></a> to use.
432388 </p>
433 <p>
434 </p>
435389 </div>
436390 <hr>
437391 <div class="refsect2">
440394 <p>
441395 The number of seconds our advertisements are valid.
442396 </p>
443 <p>
444 </p>
445397 <p>Default value: 1800</p>
446398 </div>
447399 <hr>
452404 The minimum number of milliseconds between SSDP messages.
453405 The default is 20 based on DLNA specification.
454406 </p>
455 <p>
456 </p>
457407 <p>Default value: 20</p>
458408 </div>
459409 </div>
460410 </div>
461411 <div class="footer">
462412 <hr>
463 Generated by GTK-Doc V1.15.1</div>
413 Generated by GTK-Doc V1.17.1</div>
464414 </body>
465415 </html>
77 <link rel="up" href="index.html" title="GSSDP Reference Manual">
88 <link rel="prev" href="index.html" title="GSSDP Reference Manual">
99 <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)">
1111 <link rel="stylesheet" href="style.css" type="text/css">
1212 </head>
1313 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
2020 </tr></table>
2121 <div class="chapter">
2222 <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>
2424 <div class="toc"><dl>
2525 <dt>
2626 <span class="refentrytitle"><a href="GSSDPClient.html">GSSDPClient</a></span><span class="refpurpose"> — SSDP "bus" wrapper.</span>
3838 </div>
3939 <div class="footer">
4040 <hr>
41 Generated by GTK-Doc V1.15.1</div>
41 Generated by GTK-Doc V1.17.1</div>
4242 </body>
4343 </html>
66 <link rel="home" href="index.html" title="GSSDP Reference Manual">
77 <link rel="up" href="ch01.html" title="GSSDP">
88 <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)">
1010 <link rel="stylesheet" href="style.css" type="text/css">
1111 </head>
1212 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
6868 </div>
6969 <div class="footer">
7070 <hr>
71 Generated by GTK-Doc V1.15.1</div>
71 Generated by GTK-Doc V1.17.1</div>
7272 </body>
7373 </html>
1616 <function name="gssdp_client_get_server_id ()" link="GSSDPClient.html#gssdp-client-get-server-id"/>
1717 <function name="gssdp_client_get_interface ()" link="GSSDPClient.html#gssdp-client-get-interface"/>
1818 <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"/>
1921 <function name="gssdp_client_get_active ()" link="GSSDPClient.html#gssdp-client-get-active"/>
2022 <function name="The &quot;active&quot; property" link="GSSDPClient.html#GSSDPClient--active"/>
2123 <function name="The &quot;error&quot; property" link="GSSDPClient.html#GSSDPClient--error"/>
2224 <function name="The &quot;host-ip&quot; property" link="GSSDPClient.html#GSSDPClient--host-ip"/>
2325 <function name="The &quot;interface&quot; property" link="GSSDPClient.html#GSSDPClient--interface"/>
2426 <function name="The &quot;main-context&quot; property" link="GSSDPClient.html#GSSDPClient--main-context"/>
27 <function name="The &quot;network&quot; property" link="GSSDPClient.html#GSSDPClient--network"/>
2528 <function name="The &quot;server-id&quot; property" link="GSSDPClient.html#GSSDPClient--server-id"/>
2629 <function name="The &quot;message-received&quot; signal" link="GSSDPClient.html#GSSDPClient-message-received"/>
2730 <function name="GSSDPResourceBrowser" link="GSSDPResourceBrowser.html#GSSDPResourceBrowser-struct"/>
1616 <keyword type="function" name="gssdp_client_get_server_id ()" link="GSSDPClient.html#gssdp-client-get-server-id"/>
1717 <keyword type="function" name="gssdp_client_get_interface ()" link="GSSDPClient.html#gssdp-client-get-interface"/>
1818 <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"/>
1921 <keyword type="function" name="gssdp_client_get_active ()" link="GSSDPClient.html#gssdp-client-get-active"/>
2022 <keyword type="property" name="The &quot;active&quot; property" link="GSSDPClient.html#GSSDPClient--active"/>
2123 <keyword type="property" name="The &quot;error&quot; property" link="GSSDPClient.html#GSSDPClient--error"/>
2224 <keyword type="property" name="The &quot;host-ip&quot; property" link="GSSDPClient.html#GSSDPClient--host-ip"/>
2325 <keyword type="property" name="The &quot;interface&quot; property" link="GSSDPClient.html#GSSDPClient--interface"/>
2426 <keyword type="property" name="The &quot;main-context&quot; property" link="GSSDPClient.html#GSSDPClient--main-context"/>
27 <keyword type="property" name="The &quot;network&quot; property" link="GSSDPClient.html#GSSDPClient--network"/>
2528 <keyword type="property" name="The &quot;server-id&quot; property" link="GSSDPClient.html#GSSDPClient--server-id"/>
2629 <keyword type="signal" name="The &quot;message-received&quot; signal" link="GSSDPClient.html#GSSDPClient-message-received"/>
2730 <keyword type="struct" name="GSSDPResourceBrowser" link="GSSDPResourceBrowser.html#GSSDPResourceBrowser-struct"/>
55 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
66 <link rel="home" href="index.html" title="GSSDP Reference Manual">
77 <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)">
99 <link rel="stylesheet" href="style.css" type="text/css">
1010 </head>
1111 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
1313 <div class="titlepage">
1414 <div>
1515 <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
1717 </p></div>
1818 <div><p class="copyright">Copyright © 2007 OpenedHand LTD</p></div>
1919 <div><p class="copyright">Copyright © 2009 Nokia Corporation</p></div>
2020 <div><div class="legalnotice">
21 <a name="id2859107"></a><p>
21 <a name="id3024449"></a><p>
2222 Permission is granted to copy, distribute and/or modify this
2323 document under the terms of the <em class="citetitle">GNU Free
2424 Documentation License</em>, Version 1.1 or any later
6262 </div>
6363 <div class="footer">
6464 <hr>
65 Generated by GTK-Doc V1.15.1</div>
65 Generated by GTK-Doc V1.17.1</div>
6666 </body>
6767 </html>
1111 <ANCHOR id="gssdp-client-get-server-id" href="gssdp/GSSDPClient.html#gssdp-client-get-server-id">
1212 <ANCHOR id="gssdp-client-get-interface" href="gssdp/GSSDPClient.html#gssdp-client-get-interface">
1313 <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">
1416 <ANCHOR id="gssdp-client-get-active" href="gssdp/GSSDPClient.html#gssdp-client-get-active">
1517 <ANCHOR id="GSSDPClient.property-details" href="gssdp/GSSDPClient.html#GSSDPClient.property-details">
1618 <ANCHOR id="GSSDPClient--active" href="gssdp/GSSDPClient.html#GSSDPClient--active">
1820 <ANCHOR id="GSSDPClient--host-ip" href="gssdp/GSSDPClient.html#GSSDPClient--host-ip">
1921 <ANCHOR id="GSSDPClient--interface" href="gssdp/GSSDPClient.html#GSSDPClient--interface">
2022 <ANCHOR id="GSSDPClient--main-context" href="gssdp/GSSDPClient.html#GSSDPClient--main-context">
23 <ANCHOR id="GSSDPClient--network" href="gssdp/GSSDPClient.html#GSSDPClient--network">
2124 <ANCHOR id="GSSDPClient--server-id" href="gssdp/GSSDPClient.html#GSSDPClient--server-id">
2225 <ANCHOR id="GSSDPClient.signal-details" href="gssdp/GSSDPClient.html#GSSDPClient.signal-details">
2326 <ANCHOR id="GSSDPClient-message-received" href="gssdp/GSSDPClient.html#GSSDPClient-message-received">
+0
-134
doc/tmpl/gssdp-client.sgml less more
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
-37
doc/tmpl/gssdp-error.sgml less more
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
-145
doc/tmpl/gssdp-resource-browser.sgml less more
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
-153
doc/tmpl/gssdp-resource-group.sgml less more
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
-0
doc/tmpl/gssdp-unused.sgml less more
(Empty file)
+0
-22
doc/tmpl/gssdp.sgml less more
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
0 0.8.2
0 0.10.0
2222
2323 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
2424
25 EXTRA_DIST = \
25 SETUP_FILES = \
2626 $(content_files) \
27 $(HTML_IMAGES) \
2827 $(DOC_MAIN_SGML_FILE) \
2928 $(DOC_MODULE)-sections.txt \
3029 $(DOC_MODULE)-overrides.txt
3130
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
3637
3738 SCANOBJ_FILES = \
3839 $(DOC_MODULE).args \
6970
7071 $(REPORT_FILES): sgml-build.stamp
7172
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
7295 #### scan ####
7396
7497 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
7598 @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 \
78101 _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) ; \
84106 else \
85 cd $(srcdir) ; \
86107 for i in $(SCANOBJ_FILES) ; do \
87108 test -f $$i || touch $$i ; \
88109 done \
94115
95116 #### templates ####
96117
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
98119 @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
101126 @touch tmpl-build.stamp
102127
103128 tmpl.stamp: tmpl-build.stamp
111136 sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
112137 @echo 'gtk-doc: Building XML'
113138 @-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 \
115141 _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)
119144 @touch sgml-build.stamp
120145
121146 sgml.stamp: sgml-build.stamp
125150
126151 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
127152 @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
131155 @mkhtml_options=""; \
132156 gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
133157 if test "$(?)" = "0"; then \
134 mkhtml_options=--path="$(srcdir)"; \
158 mkhtml_options=--path="$(abs_srcdir)"; \
135159 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;
138170 @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)
140172 @touch html-build.stamp
141173
142174 #### pdf ####
143175
144176 pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
145177 @echo 'gtk-doc: Building PDF'
146 @-chmod -R u+w $(srcdir)
147 @rm -rf $(srcdir)/$(DOC_MODULE).pdf
178 @rm -rf $(DOC_MODULE).pdf
148179 @mkpdf_imgdirs=""; \
149180 if test "x$(HTML_IMAGES)" != "x"; then \
150181 for img in $(HTML_IMAGES); do \
155186 fi; \
156187 done; \
157188 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)
159190 @touch pdf-build.stamp
160191
161192 ##############
165196 rm -rf .libs
166197
167198 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
171205
172206 maintainer-clean-local: clean
173 cd $(srcdir) && rm -rf xml html
207 rm -rf xml html
174208
175209 install-data-local:
176210 @installfiles=`echo $(srcdir)/html/*`; \
218252 dist-hook: dist-check-gtkdoc dist-hook-local
219253 mkdir $(distdir)/tmpl
220254 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)/
226260 cd $(distdir) && rm -f $(DISTCLEANFILES)
227261 $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
228262
4141 gssdp-resource-group.c \
4242 gssdp-socket-source.c \
4343 gssdp-socket-source.h \
44 gssdp-socket-functions.c \
45 gssdp-socket-functions.h \
4446 $(BUILT_SOURCES)
4547
4648 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
4755
4856 EXTRA_DIST = gssdp-marshal.list
4957
4545 POST_UNINSTALL = :
4646 build_triplet = @build@
4747 host_triplet = @host@
48 @OS_WIN32_TRUE@am__append_1 = -lws2_32 -liphlpapi
49 @OS_WIN32_TRUE@am__append_2 = -no-undefined
4850 subdir = libgssdp
4951 DIST_COMMON = $(libgssdpinc_HEADERS) $(srcdir)/Makefile.am \
5052 $(srcdir)/Makefile.in
8183 "$(DESTDIR)$(typelibdir)" "$(DESTDIR)$(libgssdpincdir)"
8284 LTLIBRARIES = $(lib_LTLIBRARIES)
8385 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)
8588 am__objects_1 = gssdp-marshal.lo
8689 am_libgssdp_1_0_la_OBJECTS = gssdp-client.lo gssdp-error.lo \
8790 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)
8993 libgssdp_1_0_la_OBJECTS = $(am_libgssdp_1_0_la_OBJECTS)
9094 AM_V_lt = $(am__v_lt_$(V))
9195 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
269273 gssdp.h
270274
271275 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)
273277 libgssdp_1_0_la_SOURCES = gssdp-client.c \
274278 gssdp-client-private.h \
275279 gssdp-error.c \
278282 gssdp-resource-group.c \
279283 gssdp-socket-source.c \
280284 gssdp-socket-source.h \
285 gssdp-socket-functions.c \
286 gssdp-socket-functions.h \
281287 $(BUILT_SOURCES)
282288
283 libgssdp_1_0_la_LIBADD = $(LIBGSSDP_LIBS)
289 libgssdp_1_0_la_LIBADD = $(LIBGSSDP_LIBS) $(am__append_1)
284290 EXTRA_DIST = gssdp-marshal.list
285291 @HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0
286292 @HAVE_INTROSPECTION_TRUE@gir_DATA = GSSDP-1.0.gir
369375 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gssdp-marshal.Plo@am__quote@
370376 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gssdp-resource-browser.Plo@am__quote@
371377 @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@
372379 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gssdp-socket-source.Plo@am__quote@
373380
374381 .c.o:
3030 */
3131
3232 #include <config.h>
33 #include <sys/types.h>
34 #include <glib.h>
35 #ifndef G_OS_WIN32
3336 #include <sys/socket.h>
34 #include <sys/types.h>
3537 #include <sys/utsname.h>
3638 #include <netinet/in.h>
3739 #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
3849 #include <string.h>
3950 #include <stdio.h>
4051 #include <errno.h>
4152 #include <unistd.h>
53 #ifndef G_OS_WIN32
4254 #include <arpa/inet.h>
4355 #include <net/if.h>
4456 #include <ifaddrs.h>
57 #endif
4558 #include <libsoup/soup-headers.h>
4659
4760 #include "gssdp-client.h"
5164 #include "gssdp-marshal.h"
5265 #include "gssdp-protocol.h"
5366
67 #ifndef INET6_ADDRSTRLEN
68 #define INET6_ADDRSTRLEN 46
69 #endif
70
5471 /* Size of the buffer used for reading from the socket */
5572 #define BUF_SIZE 1024
5673
6279 GMainContext *main_context;
6380
6481 char *server_id;
65 char *interface;
82 char *iface;
6683 char *host_ip;
84 char *network;
6785
6886 GError **error;
6987
7896 PROP_MAIN_CONTEXT,
7997 PROP_SERVER_ID,
8098 PROP_IFACE,
99 PROP_NETWORK,
81100 PROP_HOST_IP,
82101 PROP_ACTIVE,
83102 PROP_ERROR
97116 static char *
98117 make_server_id (void);
99118 static gboolean
100 request_socket_source_cb (gpointer user_data);
119 request_socket_source_cb (GIOChannel *source,
120 GIOCondition condition,
121 gpointer user_data);
101122 static gboolean
102 multicast_socket_source_cb (gpointer user_data);
123 multicast_socket_source_cb (GIOChannel *source,
124 GIOCondition condition,
125 gpointer user_data);
103126 static gboolean
104127 init_network_info (GSSDPClient *client);
105128
121144 gssdp_client_constructed (GObject *object)
122145 {
123146 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
124161
125162 /* Make sure all network info is available to us */
126163 if (!init_network_info (client))
129166 /* Set up sockets (Will set errno if it failed) */
130167 client->priv->request_socket =
131168 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);
133171 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);
139176 } else {
140177 goto errors;
141178 }
142179
143180 client->priv->multicast_socket =
144181 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);
146184 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);
152189 }
153190
154191 errors:
155192 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 }
162196 return;
163197 }
164198
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);
172204 }
173205
174206 static void
197229 g_value_set_string (value,
198230 gssdp_client_get_interface (client));
199231 break;
232 case PROP_NETWORK:
233 g_value_set_string (value,
234 gssdp_client_get_network (client));
235 break;
200236 case PROP_HOST_IP:
201237 g_value_set_string (value,
202238 gssdp_client_get_host_ip (client));
233269 client->priv->error = g_value_get_pointer (value);
234270 break;
235271 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);
237276 break;
238277 case PROP_ACTIVE:
239278 client->priv->active = g_value_get_boolean (value);
253292
254293 /* Destroy the SocketSources */
255294 if (client->priv->request_socket) {
256 g_source_destroy ((GSource *) client->priv->request_socket);
295 g_object_unref (client->priv->request_socket);
257296 client->priv->request_socket = NULL;
258297 }
259298
260299 if (client->priv->multicast_socket) {
261 g_source_destroy ((GSource *) client->priv->multicast_socket);
300 g_object_unref (client->priv->multicast_socket);
262301 client->priv->multicast_socket = NULL;
263302 }
264303
277316 GSSDPClient *client;
278317
279318 client = GSSDP_CLIENT (object);
319 #ifdef G_OS_WIN32
320 WSACleanup ();
321 #endif
280322
281323 g_free (client->priv->server_id);
282 g_free (client->priv->interface);
324 g_free (client->priv->iface);
283325 g_free (client->priv->host_ip);
326 g_free (client->priv->network);
284327
285328 G_OBJECT_CLASS (gssdp_client_parent_class)->finalize (object);
286329 }
368411 NULL,
369412 G_PARAM_READWRITE |
370413 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 |
371438 G_PARAM_STATIC_NAME |
372439 G_PARAM_STATIC_NICK |
373440 G_PARAM_STATIC_BLURB));
443510 **/
444511 GSSDPClient *
445512 gssdp_client_new (GMainContext *main_context,
446 const char *interface,
513 const char *iface,
447514 GError **error)
448515 {
449516 return g_object_new (GSSDP_TYPE_CLIENT,
450517 "main-context", main_context,
451 "interface", interface,
518 "interface", iface,
452519 "error", error,
453520 NULL);
454521 }
534601 {
535602 g_return_val_if_fail (GSSDP_IS_CLIENT (client), NULL);
536603
537 return client->priv->interface;
604 return client->priv->iface;
538605 }
539606
540607 /**
551618 g_return_val_if_fail (GSSDP_IS_CLIENT (client), NULL);
552619
553620 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;
554661 }
555662
556663 /**
582689 gushort dest_port,
583690 const char *message)
584691 {
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;
587697
588698 g_return_if_fail (GSSDP_IS_CLIENT (client));
589699 g_return_if_fail (message != NULL);
600710 if (dest_port == 0)
601711 dest_port = SSDP_PORT;
602712
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);
617722
618723 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);
622732 }
623733
624734 /**
627737 static char *
628738 make_server_id (void)
629739 {
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
630753 struct utsname sysinfo;
631754
632755 uname (&sysinfo);
635758 sysinfo.sysname,
636759 sysinfo.version,
637760 VERSION);
761 #endif
638762 }
639763
640764 static gboolean
705829 }
706830 }
707831
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
708846 /**
709847 * Called when data can be read from the socket
710848 **/
711849 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;
716853 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;
717865 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);
736875 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;
742880 }
743881
744882 /* We need the following lines to make sure the right client received
747885 * on this socket from a particular interface but AFAIK that is not
748886 * possible, at least not in a portable way.
749887 */
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
750899 recv_network = inet_netof (addr.sin_addr);
751900 our_addr.s_addr = inet_addr (gssdp_client_get_host_ip (client));
752901 our_network = inet_netof (our_addr);
753902 if (recv_network != our_network)
754 return TRUE;
903 goto out;
755904
756905 if (bytes >= BUF_SIZE) {
757906 g_warning ("Received packet of %u bytes, but the maximum "
758907 "buffer size is %d. Packed dropped.",
759908 (unsigned int) bytes, BUF_SIZE);
760909
761 return TRUE;
910 goto out;
762911 }
763912
764913 /* Add trailing \0 */
770919 g_warning ("Received packet lacks \"\\r\\n\\r\\n\" sequence. "
771920 "Packed dropped.");
772921
773 return TRUE;
922 goto out;
774923 }
775924
776925 len = end - buf + 2;
792941 }
793942
794943 /* 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));
795949 if (type >= 0) {
796950 g_signal_emit (client,
797951 signals[MESSAGE_RECEIVED],
798952 0,
799 inet_ntoa (addr.sin_addr),
800 ntohs (addr.sin_port),
953 ip_string,
954 port,
801955 type,
802956 headers);
803957 }
804958
959 out:
960 if (error)
961 g_error_free (error);
962
963 if (ip_string)
964 g_free (ip_string);
965
805966 if (headers)
806967 soup_message_headers_free (headers);
807968
969 if (address)
970 g_object_unref (address);
971
808972 return TRUE;
809973 }
810974
811975 static gboolean
812 request_socket_source_cb (gpointer user_data)
976 request_socket_source_cb (GIOChannel *source,
977 GIOCondition condition,
978 gpointer user_data)
813979 {
814980 GSSDPClient *client;
815981
819985 }
820986
821987 static gboolean
822 multicast_socket_source_cb (gpointer user_data)
988 multicast_socket_source_cb (GIOChannel *source,
989 GIOCondition condition,
990 gpointer user_data)
823991 {
824992 GSSDPClient *client;
825993
827995
828996 return socket_source_cb (client->priv->multicast_socket, client);
829997 }
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
8301042
8311043 /*
8321044 * Get the host IP for the specified interface. If no interface is specified,
8331045 * it gets the IP of the first up & running interface and sets @interface
8341046 * appropriately.
8351047 */
1048
8361049 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
8391147 struct ifaddrs *ifa_list, *ifa;
8401148 char *ret;
841 GList *up_ifaces, *iface;
1149 GList *up_ifaces, *ifaceptr;
8421150
8431151 ret = NULL;
8441152 up_ifaces = NULL;
8541162 if (ifa->ifa_addr == NULL)
8551163 continue;
8561164
857 if (*interface && strcmp (*interface, ifa->ifa_name) != 0)
1165 if (*iface && strcmp (*iface, ifa->ifa_name) != 0)
8581166 continue;
8591167 else if (!(ifa->ifa_flags & IFF_UP))
8601168 continue;
8691177 up_ifaces = g_list_prepend (up_ifaces, ifa);
8701178 }
8711179
872 for (iface = up_ifaces; iface != NULL; iface = iface->next) {
1180 for (ifaceptr = up_ifaces;
1181 ifaceptr != NULL;
1182 ifaceptr = ifaceptr->next) {
8731183 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;
8771191
8781192 p = NULL;
8791193
880 ifa = iface->data;
1194 ifa = ifaceptr->data;
8811195
8821196 switch (ifa->ifa_addr->sa_family) {
8831197 case AF_INET:
8841198 s4 = (struct sockaddr_in *) ifa->ifa_addr;
8851199 p = inet_ntop (AF_INET,
8861200 &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));
8871205 break;
8881206 case AF_INET6:
8891207 s6 = (struct sockaddr_in6 *) ifa->ifa_addr;
8901208 p = inet_ntop (AF_INET6,
8911209 &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));
8921219 break;
8931220 default:
8941221 continue; /* Unknown: ignore */
8971224 if (p != NULL) {
8981225 ret = g_strdup (p);
8991226
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);
9021231 break;
9031232 }
9041233 }
9071236 freeifaddrs (ifa_list);
9081237
9091238 return ret;
1239 #endif
9101240 }
9111241
9121242 static gboolean
9141244 {
9151245 gboolean ret = TRUE;
9161246
917 if (client->priv->interface == NULL || client->priv->host_ip == NULL)
1247 if (client->priv->iface == NULL || client->priv->host_ip == NULL)
9181248 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) {
9221253 if (client->priv->error)
9231254 g_set_error (client->priv->error,
9241255 GSSDP_ERROR,
9321263 GSSDP_ERROR,
9331264 GSSDP_ERROR_NO_IP_ADDRESS,
9341265 "Failed to find IP of interface %s",
935 client->priv->interface);
1266 client->priv->iface);
9361267
9371268 ret = FALSE;
9381269 }
6969
7070 GSSDPClient *
7171 gssdp_client_new (GMainContext *main_context,
72 const char *interface,
72 const char *iface,
7373 GError **error);
7474
7575 GMainContext *
8888 const char *
8989 gssdp_client_get_host_ip (GSSDPClient *client);
9090
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
9198 gboolean
9299 gssdp_client_get_active (GSSDPClient *client);
93100
5858 "NT: %s\r\n" \
5959 "USN: %s\r\n\r\n"
6060
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
6172 #define SSDP_BYEBYE_MESSAGE \
6273 "NOTIFY * HTTP/1.1\r\n" \
6374 "Host: " SSDP_ADDR ":" SSDP_PORT_STR "\r\n" \
6475 "NTS: ssdp:byebye\r\n" \
6576 "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" \
6684 "USN: %s\r\n\r\n"
6785
6886 #define SSDP_SEARCH_METHOD "M-SEARCH"
579579 static gboolean
580580 resource_expire (gpointer user_data)
581581 {
582 GSSDPResourceBrowser *resource_browser;
582583 Resource *resource;
583584 char *usn;
584585
585586 resource = user_data;
587 resource_browser = resource->resource_browser;
586588
587589 /* Steal the USN pointer from the resource as we need it for the signal
588590 * emission.
592594
593595 g_hash_table_remove (resource->resource_browser->priv->resources, usn);
594596
595 g_signal_emit (resource->resource_browser,
597 g_signal_emit (resource_browser,
596598 signals[RESOURCE_UNAVAILABLE],
597599 0,
598600 usn);
9696 } DiscoveryResponse;
9797
9898 #define DEFAULT_MESSAGE_DELAY 20
99 #define VERSION_PATTERN "[0-9]+$"
99100
100101 /* Function prototypes */
101102 static void
122123 discovery_response_free (DiscoveryResponse *response);
123124 static gboolean
124125 process_queue (gpointer data);
126 static char *
127 get_version_for_target (char *target);
125128 static GRegex *
126129 create_target_regex (const char *target,
127130 GError **error);
502505 GMainContext *context;
503506 int timeout;
504507
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 * */
506514 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;
509517
510518 /* Add re-announcement timer */
511519 resource_group->priv->timeout_src =
973981 }
974982
975983 /**
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
9771038 **/
9781039 static void
9791040 resource_alive (Resource *resource)
9801041 {
9811042 GSSDPClient *client;
9821043 guint max_age;
983 char *al, *message;
1044 char *al;
9841045
9851046 if (!resource->initial_alive_sent) {
9861047 /* Unannounce before first announce. This is done to
9981059
9991060 al = construct_al (resource);
10001061
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);
10101069
10111070 g_free (al);
10121071 }
10171076 static void
10181077 resource_byebye (Resource *resource)
10191078 {
1079 char *version_str;
10201080 char *message;
10211081
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 }
10281111 }
10291112
10301113 /**
10541137 g_slice_free (Resource, resource);
10551138 }
10561139
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
10571159 static GRegex *
10581160 create_target_regex (const char *target, GError **error)
10591161 {
10601162 GRegex *regex;
10611163 char *pattern;
10621164 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
10711166 /* Make sure we have enough room for version pattern */
10721167 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);
10801173
10811174 regex = g_regex_new (pattern, 0, 0, error);
10821175
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
00 /*
11 * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd.
22 * Copyright (C) 2009 Nokia Corporation, all rights reserved.
3 * Copyright (C) 2010 Jens Georg <mail@jensge.org>
34 *
45 * Author: Jorn Baayen <jorn@openedhand.com>
56 * Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
67 * <zeeshan.ali@nokia.com>
8 * Jens Georg <mail@jensge.org>
79 *
810 * This library is free software; you can redistribute it and/or
911 * modify it under the terms of the GNU Library General Public
2325
2426 #include <config.h>
2527 #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"
3530 #include "gssdp-socket-source.h"
3631 #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;
4250 };
4351
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
4466 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 }
62119
63120 /**
64121 * gssdp_socket_source_new
67124 **/
68125 GSSDPSocketSource *
69126 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
86181
87182 /* 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 }
97195
98196 /* 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 }
106205
107206 /* 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 }
123215 /* 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);
130243 #else
131 SO_REUSEADDR,
244 bind_address = g_inet_socket_address_new (group,
245 SSDP_PORT);
132246 #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
136295 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);
193302 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;
247317 }
248318
249319 return TRUE;
250320 }
251321
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 }
00 /*
11 * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd.
2 * Copyright (C) 2010 Jens Georg <mail@jensge.org>
23 *
34 * Author: Jorn Baayen <jorn@openedhand.com>
5 * Jens Georg <mail@jensge.org>
46 *
57 * This library is free software; you can redistribute it and/or
68 * modify it under the terms of the GNU Library General Public
2123 #ifndef __GSSDP_SOCKET_SOURCE_H__
2224 #define __GSSDP_SOCKET_SOURCE_H__
2325
26 #include <glib-object.h>
27
28 #include <gio/gio.h>
29
2430 G_BEGIN_DECLS
2531
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;
2754
2855 typedef enum {
2956 GSSDP_SOCKET_SOURCE_TYPE_REQUEST,
3057 GSSDP_SOCKET_SOURCE_TYPE_MULTICAST
3158 } GSSDPSocketSourceType;
3259
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
3372 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);
3678
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);
3987
4088 G_END_DECLS
4189
6868 }
6969
7070 resource_browser = gssdp_resource_browser_new (client,
71 GSSDP_ALL_RESOURCES);
71 "urn:schemas-upnp-org:device:MediaServer:1");
7272
7373 g_signal_connect (resource_browser,
7474 "resource-available",