Imported Upstream version 0.1.3
Laurent Bigonville
14 years ago
0 | ||
1 | ******************* | |
2 | * GUPnP IGD 0.1.3 * | |
3 | ******************* | |
4 | ||
5 | - Delete all mappings when the last user reference is dropped | |
6 | - Don't try to renew an infinite mapping | |
0 | 7 | |
1 | 8 | ******************* |
2 | 9 | * GUPnP IGD 0.1.2 * |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.63 for gupnp-igd 0.1.2. | |
2 | # Generated by GNU Autoconf 2.63 for gupnp-igd 0.1.3. | |
3 | 3 | # |
4 | 4 | # Report bugs to <http://www.gupnp.org/>. |
5 | 5 | # |
749 | 749 | # Identity of this package. |
750 | 750 | PACKAGE_NAME='gupnp-igd' |
751 | 751 | PACKAGE_TARNAME='gupnp-igd' |
752 | PACKAGE_VERSION='0.1.2' | |
753 | PACKAGE_STRING='gupnp-igd 0.1.2' | |
752 | PACKAGE_VERSION='0.1.3' | |
753 | PACKAGE_STRING='gupnp-igd 0.1.3' | |
754 | 754 | PACKAGE_BUGREPORT='http://www.gupnp.org/' |
755 | 755 | |
756 | 756 | ac_unique_file="libgupnp-igd/gupnp-simple-igd.h" |
1497 | 1497 | # Omit some internal or obsolete options to make the list less imposing. |
1498 | 1498 | # This message is too long to be a string in the A/UX 3.1 sh. |
1499 | 1499 | cat <<_ACEOF |
1500 | \`configure' configures gupnp-igd 0.1.2 to adapt to many kinds of systems. | |
1500 | \`configure' configures gupnp-igd 0.1.3 to adapt to many kinds of systems. | |
1501 | 1501 | |
1502 | 1502 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1503 | 1503 | |
1567 | 1567 | |
1568 | 1568 | if test -n "$ac_init_help"; then |
1569 | 1569 | case $ac_init_help in |
1570 | short | recursive ) echo "Configuration of gupnp-igd 0.1.2:";; | |
1570 | short | recursive ) echo "Configuration of gupnp-igd 0.1.3:";; | |
1571 | 1571 | esac |
1572 | 1572 | cat <<\_ACEOF |
1573 | 1573 | |
1682 | 1682 | test -n "$ac_init_help" && exit $ac_status |
1683 | 1683 | if $ac_init_version; then |
1684 | 1684 | cat <<\_ACEOF |
1685 | gupnp-igd configure 0.1.2 | |
1685 | gupnp-igd configure 0.1.3 | |
1686 | 1686 | generated by GNU Autoconf 2.63 |
1687 | 1687 | |
1688 | 1688 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
1696 | 1696 | This file contains any messages produced by compilers while |
1697 | 1697 | running configure, to aid debugging if configure makes a mistake. |
1698 | 1698 | |
1699 | It was created by gupnp-igd $as_me 0.1.2, which was | |
1699 | It was created by gupnp-igd $as_me 0.1.3, which was | |
1700 | 1700 | generated by GNU Autoconf 2.63. Invocation command line was |
1701 | 1701 | |
1702 | 1702 | $ $0 $@ |
2412 | 2412 | |
2413 | 2413 | # Define the identity of the package. |
2414 | 2414 | PACKAGE='gupnp-igd' |
2415 | VERSION='0.1.2' | |
2415 | VERSION='0.1.3' | |
2416 | 2416 | |
2417 | 2417 | |
2418 | 2418 | cat >>confdefs.h <<_ACEOF |
22229 | 22229 | # report actual input values of CONFIG_FILES etc. instead of their |
22230 | 22230 | # values after options handling. |
22231 | 22231 | ac_log=" |
22232 | This file was extended by gupnp-igd $as_me 0.1.2, which was | |
22232 | This file was extended by gupnp-igd $as_me 0.1.3, which was | |
22233 | 22233 | generated by GNU Autoconf 2.63. Invocation command line was |
22234 | 22234 | |
22235 | 22235 | CONFIG_FILES = $CONFIG_FILES |
22292 | 22292 | _ACEOF |
22293 | 22293 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
22294 | 22294 | ac_cs_version="\\ |
22295 | gupnp-igd config.status 0.1.2 | |
22295 | gupnp-igd config.status 0.1.3 | |
22296 | 22296 | configured by $0, generated by GNU Autoconf 2.63, |
22297 | 22297 | with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" |
22298 | 22298 |
0 | 0 | AC_PREREQ(2.53) |
1 | AC_INIT(gupnp-igd, 0.1.2, http://www.gupnp.org/) | |
1 | AC_INIT(gupnp-igd, 0.1.3, http://www.gupnp.org/) | |
2 | 2 | AM_INIT_AUTOMAKE() |
3 | 3 | AC_CONFIG_SRCDIR(libgupnp-igd/gupnp-simple-igd.h) |
4 | 4 | AM_CONFIG_HEADER(config.h) |
243 | 243 | @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
244 | 244 | @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) |
245 | 245 | @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) |
246 | @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = sh -c | |
247 | @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute | |
246 | 248 | |
247 | 249 | # We set GPATH here; this gives us semantics for GNU make |
248 | 250 | # which are more like other make's VPATH, when it comes to |
457 | 459 | |
458 | 460 | docs: html-build.stamp |
459 | 461 | |
462 | $(REPORT_FILES): sgml-build.stamp | |
463 | ||
460 | 464 | #### scan #### |
461 | 465 | |
462 | 466 | scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) |
465 | 469 | cd $(srcdir) && \ |
466 | 470 | gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) |
467 | 471 | if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ |
468 | CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ | |
472 | 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) ; \ | |
469 | 473 | else \ |
470 | 474 | cd $(srcdir) ; \ |
471 | 475 | for i in $(SCANOBJ_FILES) ; do \ |
510 | 514 | @-chmod -R u+w $(srcdir) |
511 | 515 | rm -rf $(srcdir)/html |
512 | 516 | mkdir $(srcdir)/html |
513 | cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) | |
517 | mkhtml_options=""; \ | |
518 | gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ | |
519 | if test "$(?)" = "0"; then \ | |
520 | mkhtml_options=--path="$(srcdir)"; \ | |
521 | fi | |
522 | cd $(srcdir)/html && gtkdoc-mkhtml $(mkhtml_options) $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) | |
514 | 523 | test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) |
515 | 524 | @echo 'gtk-doc: Fixing cross-references' |
516 | 525 | cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) |
531 | 540 | cd $(srcdir) && rm -rf xml html |
532 | 541 | |
533 | 542 | install-data-local: |
534 | -installfiles=`echo $(srcdir)/html/*`; \ | |
543 | installfiles=`echo $(srcdir)/html/*`; \ | |
535 | 544 | if test "$$installfiles" = '$(srcdir)/html/*'; \ |
536 | 545 | then echo '-- Nothing to install' ; \ |
537 | 546 | else \ |
538 | $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ | |
547 | if test -n "$(DOC_MODULE_VERSION)"; then \ | |
548 | installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ | |
549 | else \ | |
550 | installdir="$(DESTDIR)$(TARGET_DIR)"; \ | |
551 | fi; \ | |
552 | $(mkinstalldirs) $${installdir} ; \ | |
539 | 553 | for i in $$installfiles; do \ |
540 | 554 | echo '-- Installing '$$i ; \ |
541 | $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ | |
555 | $(INSTALL_DATA) $$i $${installdir}; \ | |
542 | 556 | done; \ |
543 | echo '-- Installing $(srcdir)/html/index.sgml' ; \ | |
544 | $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ | |
545 | which gtkdoc-rebase >/dev/null && \ | |
546 | gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \ | |
557 | if test -n "$(DOC_MODULE_VERSION)"; then \ | |
558 | mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ | |
559 | $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ | |
560 | mv -f $${installdir}/$(DOC_MODULE).devhelp \ | |
561 | $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ | |
562 | fi; \ | |
563 | ! which gtkdoc-rebase >/dev/null 2>&1 || \ | |
564 | gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir} ; \ | |
547 | 565 | fi |
548 | 566 | |
549 | 567 | uninstall-local: |
550 | rm -f $(DESTDIR)$(TARGET_DIR)/* | |
568 | if test -n "$(DOC_MODULE_VERSION)"; then \ | |
569 | installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ | |
570 | else \ | |
571 | installdir="$(DESTDIR)$(TARGET_DIR)"; \ | |
572 | fi; \ | |
573 | rm -rf $${installdir} | |
551 | 574 | |
552 | 575 | # |
553 | 576 | # Require gtk-doc when making dist |
567 | 590 | -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ |
568 | 591 | -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ |
569 | 592 | cd $(distdir) && rm -f $(DISTCLEANFILES) |
570 | -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html | |
593 | ! which gtkdoc-rebase >/dev/null 2>&1 || \ | |
594 | gtkdoc-rebase --online --relative --html-dir=$(distdir)/html | |
571 | 595 | |
572 | 596 | .PHONY : dist-hook-local docs |
573 | 597 |
7 | 7 | <link rel="up" href="ch01.html" title="Simple IGD module"> |
8 | 8 | <link rel="prev" href="ch01.html" title="Simple IGD module"> |
9 | 9 | <link rel="next" href="GUPnPSimpleIgdThread.html" title="GUPnPSimpleIgdThread"> |
10 | <meta name="generator" content="GTK-Doc V1.10 (XML mode)"> | |
10 | <meta name="generator" content="GTK-Doc V1.11 (XML mode)"> | |
11 | 11 | <link rel="stylesheet" href="style.css" type="text/css"> |
12 | 12 | <link rel="chapter" href="ch01.html" title="Simple IGD module"> |
13 | 13 | </head> |
20 | 20 | <th width="100%" align="center">GUPnP IGD Reference Manual</th> |
21 | 21 | <td><a accesskey="n" href="GUPnPSimpleIgdThread.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> |
22 | 22 | </tr> |
23 | <tr><td colspan="5" class="shortcuts"><nobr><a href="#GUPnPSimpleIgd.synopsis" class="shortcut">Top</a> | |
24 | Â |Â | |
25 | <a href="#GUPnPSimpleIgd.description" class="shortcut">Description</a> | |
26 | Â |Â | |
27 | <a href="#GUPnPSimpleIgd.object-hierarchy" class="shortcut">Object Hierarchy</a> | |
28 | Â |Â | |
29 | <a href="#GUPnPSimpleIgd.properties" class="shortcut">Properties</a> | |
30 | Â |Â | |
31 | <a href="#GUPnPSimpleIgd.signals" class="shortcut">Signals</a></nobr></td></tr> | |
23 | <tr><td colspan="5" class="shortcuts"> | |
24 | <a href="#GUPnPSimpleIgd.synopsis" class="shortcut">Top</a> | |
25 | Â |Â | |
26 | <a href="#GUPnPSimpleIgd.description" class="shortcut">Description</a> | |
27 | Â |Â | |
28 | <a href="#GUPnPSimpleIgd.object-hierarchy" class="shortcut">Object Hierarchy</a> | |
29 | Â |Â | |
30 | <a href="#GUPnPSimpleIgd.properties" class="shortcut">Properties</a> | |
31 | Â |Â | |
32 | <a href="#GUPnPSimpleIgd.signals" class="shortcut">Signals</a> | |
33 | </td></tr> | |
32 | 34 | </table> |
33 | 35 | <div class="refentry" lang="en"> |
34 | 36 | <a name="GUPnPSimpleIgd"></a><div class="titlepage"></div> |
44 | 46 | <pre class="synopsis"> |
45 | 47 | <a class="link" href="GUPnPSimpleIgd.html#GUPnPSimpleIgd-struct" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a>; |
46 | 48 | <a class="link" href="GUPnPSimpleIgd.html#GUPnPSimpleIgdClass" title="GUPnPSimpleIgdClass">GUPnPSimpleIgdClass</a>; |
47 | #define <a class="link" href="GUPnPSimpleIgd.html#GUPNP-SIMPLE-IGD-ERROR:CAPS" title="GUPNP_SIMPLE_IGD_ERROR">GUPNP_SIMPLE_IGD_ERROR</a> | |
49 | #define <a class="link" href="GUPnPSimpleIgd.html#GUPNP-SIMPLE-IGD-ERROR--CAPS" title="GUPNP_SIMPLE_IGD_ERROR">GUPNP_SIMPLE_IGD_ERROR</a> | |
48 | 50 | enum <a class="link" href="GUPnPSimpleIgd.html#GUPnPSimpleIgdError" title="enum GUPnPSimpleIgdError">GUPnPSimpleIgdError</a>; |
49 | <a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a>* <a class="link" href="GUPnPSimpleIgd.html#gupnp-simple-igd-new" title="gupnp_simple_igd_new ()">gupnp_simple_igd_new</a> (<a | |
50 | href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GMainContext" | |
51 | <a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> * <a class="link" href="GUPnPSimpleIgd.html#gupnp-simple-igd-new" title="gupnp_simple_igd_new ()">gupnp_simple_igd_new</a> (<a | |
52 | href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext" | |
51 | 53 | >GMainContext</a> *main_context); |
52 | 54 | <a |
53 | 55 | href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void" |
54 | 56 | >void</a> <a class="link" href="GUPnPSimpleIgd.html#gupnp-simple-igd-add-port" title="gupnp_simple_igd_add_port ()">gupnp_simple_igd_add_port</a> (<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> *self, |
55 | 57 | const <a |
56 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
58 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
57 | 59 | >gchar</a> *protocol, |
58 | 60 | <a |
59 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16" | |
61 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint16" | |
60 | 62 | >guint16</a> external_port, |
61 | 63 | const <a |
62 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
64 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
63 | 65 | >gchar</a> *local_ip, |
64 | 66 | <a |
65 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16" | |
67 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint16" | |
66 | 68 | >guint16</a> local_port, |
67 | 69 | <a |
68 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32" | |
70 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32" | |
69 | 71 | >guint32</a> lease_duration, |
70 | 72 | const <a |
71 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
73 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
72 | 74 | >gchar</a> *description); |
73 | 75 | <a |
74 | 76 | href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void" |
75 | 77 | >void</a> <a class="link" href="GUPnPSimpleIgd.html#gupnp-simple-igd-remove-port" title="gupnp_simple_igd_remove_port ()">gupnp_simple_igd_remove_port</a> (<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> *self, |
76 | 78 | const <a |
77 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
79 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
78 | 80 | >gchar</a> *protocol, |
79 | 81 | <a |
80 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" | |
82 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint" | |
81 | 83 | >guint</a> external_port); |
82 | 84 | </pre> |
83 | 85 | </div> |
85 | 87 | <a name="GUPnPSimpleIgd.object-hierarchy"></a><h2>Object Hierarchy</h2> |
86 | 88 | <pre class="synopsis"> |
87 | 89 | <a |
88 | href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject" | |
90 | href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject" | |
89 | 91 | >GObject</a> |
90 | 92 | +----GUPnPSimpleIgd |
91 | 93 | +----<a class="link" href="GUPnPSimpleIgdThread.html" title="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</a> |
95 | 97 | <a name="GUPnPSimpleIgd.properties"></a><h2>Properties</h2> |
96 | 98 | <pre class="synopsis"> |
97 | 99 | "<a class="link" href="GUPnPSimpleIgd.html#GUPnPSimpleIgd--main-context" title='The "main-context" property'>main-context</a>" <a |
98 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" | |
100 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer" | |
99 | 101 | >gpointer</a> : Read / Write / Construct Only |
100 | 102 | "<a class="link" href="GUPnPSimpleIgd.html#GUPnPSimpleIgd--request-timeout" title='The "request-timeout" property'>request-timeout</a>" <a |
101 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" | |
103 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint" | |
102 | 104 | >guint</a> : Read / Write |
103 | 105 | </pre> |
104 | 106 | </div> |
117 | 119 | It also allows implementations to know the external port from the router's |
118 | 120 | perspective.</p> |
119 | 121 | <p> |
120 | ||
121 | 122 | </p> |
122 | 123 | </div> |
123 | 124 | <div class="refsect1" lang="en"> |
128 | 129 | <p> |
129 | 130 | All members are private, access them using methods and properties</p> |
130 | 131 | <p> |
131 | ||
132 | 132 | </p> |
133 | 133 | </div> |
134 | 134 | <hr> |
155 | 155 | <p> |
156 | 156 | The Raw UDP component transmitter class</p> |
157 | 157 | <p> |
158 | ||
159 | 158 | </p> |
160 | 159 | <div class="variablelist"><table border="0"> |
161 | 160 | <col align="left" valign="top"> |
162 | 161 | <tbody> |
163 | 162 | <tr> |
164 | 163 | <td><p><span class="term"><a |
165 | href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObjectClass" | |
164 | href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObjectClass" | |
166 | 165 | >GObjectClass</a>Â <em class="structfield"><code>parent_class</code></em>;</span></p></td> |
167 | 166 | <td> Our parent |
168 | 167 | </td> |
182 | 181 | </div> |
183 | 182 | <hr> |
184 | 183 | <div class="refsect2" lang="en"> |
185 | <a name="GUPNP-SIMPLE-IGD-ERROR:CAPS"></a><h3>GUPNP_SIMPLE_IGD_ERROR</h3> | |
184 | <a name="GUPNP-SIMPLE-IGD-ERROR--CAPS"></a><h3>GUPNP_SIMPLE_IGD_ERROR</h3> | |
186 | 185 | <pre class="programlisting">#define GUPNP_SIMPLE_IGD_ERROR (gupnp_simple_igd_get_error_domain ()) |
187 | 186 | </pre> |
188 | 187 | <p> |
189 | 188 | The <a |
190 | href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError" | |
189 | href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError" | |
191 | 190 | ><span class="type">GError</span></a> domain for error coming out of GUPnpSimpleIGD</p> |
192 | 191 | <p> |
193 | ||
194 | 192 | </p> |
195 | 193 | </div> |
196 | 194 | <hr> |
203 | 201 | <p> |
204 | 202 | Errors coming out of the GUPnPSimpleIGD object.</p> |
205 | 203 | <p> |
206 | ||
207 | 204 | </p> |
208 | 205 | <div class="variablelist"><table border="0"> |
209 | 206 | <col align="left" valign="top"> |
210 | 207 | <tbody><tr> |
211 | <td><p><a name="GUPNP-SIMPLE-IGD-ERROR-EXTERNAL-ADDRESS:CAPS"></a><span class="term"><code class="literal">GUPNP_SIMPLE_IGD_ERROR_EXTERNAL_ADDRESS</code></span></p></td> | |
208 | <td><p><a name="GUPNP-SIMPLE-IGD-ERROR-EXTERNAL-ADDRESS--CAPS"></a><span class="term"><code class="literal">GUPNP_SIMPLE_IGD_ERROR_EXTERNAL_ADDRESS</code></span></p></td> | |
212 | 209 | <td> Error getting the external |
213 | 210 | address of the router |
214 | 211 | </td> |
218 | 215 | <hr> |
219 | 216 | <div class="refsect2" lang="en"> |
220 | 217 | <a name="gupnp-simple-igd-new"></a><h3>gupnp_simple_igd_new ()</h3> |
221 | <pre class="programlisting"><a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a>* gupnp_simple_igd_new (<a | |
222 | href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GMainContext" | |
218 | <pre class="programlisting"><a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> * gupnp_simple_igd_new (<a | |
219 | href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext" | |
223 | 220 | >GMainContext</a> *main_context);</pre> |
224 | 221 | <p> |
225 | 222 | This creates a new <span class="type">GUPnpSimpleIgd</span> object using the special GMainContext</p> |
226 | 223 | <p> |
227 | ||
228 | 224 | </p> |
229 | 225 | <div class="variablelist"><table border="0"> |
230 | 226 | <col align="left" valign="top"> |
232 | 228 | <tr> |
233 | 229 | <td><p><span class="term"><em class="parameter"><code>main_context</code></em>Â :</span></p></td> |
234 | 230 | <td> the <a |
235 | href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GMainContext" | |
231 | href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext" | |
236 | 232 | ><span class="type">GMainContext</span></a> to use (may be NULL for the default |
237 | 233 | main context) |
238 | 234 | </td> |
252 | 248 | href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void" |
253 | 249 | >void</a> gupnp_simple_igd_add_port (<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> *self, |
254 | 250 | const <a |
255 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
251 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
256 | 252 | >gchar</a> *protocol, |
257 | 253 | <a |
258 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16" | |
254 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint16" | |
259 | 255 | >guint16</a> external_port, |
260 | 256 | const <a |
261 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
257 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
262 | 258 | >gchar</a> *local_ip, |
263 | 259 | <a |
264 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16" | |
260 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint16" | |
265 | 261 | >guint16</a> local_port, |
266 | 262 | <a |
267 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32" | |
263 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32" | |
268 | 264 | >guint32</a> lease_duration, |
269 | 265 | const <a |
270 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
266 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
271 | 267 | >gchar</a> *description);</pre> |
272 | 268 | <p> |
273 | 269 | This adds a port to the router's forwarding table. The mapping will |
280 | 276 | <a class="link" href="GUPnPSimpleIgd.html#GUPnPSimpleIgd-mapped-external-port" title='The "mapped-external-port" signal'><span class="type">"mapped-external-port"</span></a> will be emitted. These signals may |
281 | 277 | be emitted multiple times if there are multiple routers present.</p> |
282 | 278 | <p> |
283 | ||
284 | 279 | </p> |
285 | 280 | <div class="variablelist"><table border="0"> |
286 | 281 | <col align="left" valign="top"> |
332 | 327 | href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void" |
333 | 328 | >void</a> gupnp_simple_igd_remove_port (<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> *self, |
334 | 329 | const <a |
335 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
330 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
336 | 331 | >gchar</a> *protocol, |
337 | 332 | <a |
338 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" | |
333 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint" | |
339 | 334 | >guint</a> external_port);</pre> |
340 | 335 | <p> |
341 | 336 | This tries to remove a port entry from the routers that was previously added |
343 | 338 | it is a best effort mechanism. If it fails, the bindings will disapears after |
344 | 339 | the lease duration set when the port where added.</p> |
345 | 340 | <p> |
346 | ||
347 | 341 | </p> |
348 | 342 | <div class="variablelist"><table border="0"> |
349 | 343 | <col align="left" valign="top"> |
374 | 368 | <div class="refsect2" lang="en"> |
375 | 369 | <a name="GUPnPSimpleIgd--main-context"></a><h3>The <code class="literal">"main-context"</code> property</h3> |
376 | 370 | <pre class="programlisting"> "main-context" <a |
377 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" | |
371 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer" | |
378 | 372 | >gpointer</a> : Read / Write / Construct Only</pre> |
379 | 373 | <p>This GMainContext will be used for all async activities.</p> |
380 | 374 | </div> |
382 | 376 | <div class="refsect2" lang="en"> |
383 | 377 | <a name="GUPnPSimpleIgd--request-timeout"></a><h3>The <code class="literal">"request-timeout"</code> property</h3> |
384 | 378 | <pre class="programlisting"> "request-timeout" <a |
385 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" | |
379 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint" | |
386 | 380 | >guint</a> : Read / Write</pre> |
387 | 381 | <p>After this timeout, the request is considered to have failed andis dropped (in seconds).</p> |
388 | 382 | <p>Default value: 5</p> |
396 | 390 | href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void" |
397 | 391 | >void</a> user_function (<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> *self, |
398 | 392 | <a |
399 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" | |
393 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer" | |
400 | 394 | >gpointer</a> error, |
401 | 395 | <a |
402 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
396 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
403 | 397 | >gchar</a> *proto, |
404 | 398 | <a |
405 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" | |
399 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint" | |
406 | 400 | >guint</a> external_port, |
407 | 401 | <a |
408 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
402 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
409 | 403 | >gchar</a> *local_ip, |
410 | 404 | <a |
411 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" | |
405 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint" | |
412 | 406 | >guint</a> local_port, |
413 | 407 | <a |
414 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
408 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
415 | 409 | >gchar</a> *description, |
416 | 410 | <a |
417 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" | |
411 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer" | |
418 | 412 | >gpointer</a> user_data) : Run Last / Has Details</pre> |
419 | 413 | <p> |
420 | 414 | This means that mapping a port on a specific IGD has failed (it may still |
421 | 415 | succeed on other IGDs on the network).</p> |
422 | 416 | <p> |
423 | ||
424 | 417 | </p> |
425 | 418 | <div class="variablelist"><table border="0"> |
426 | 419 | <col align="left" valign="top"> |
433 | 426 | <tr> |
434 | 427 | <td><p><span class="term"><em class="parameter"><code>error</code></em>Â :</span></p></td> |
435 | 428 | <td> a <a |
436 | href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError" | |
429 | href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError" | |
437 | 430 | ><span class="type">GError</span></a> |
438 | 431 | </td> |
439 | 432 | </tr> |
476 | 469 | href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void" |
477 | 470 | >void</a> user_function (<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> *self, |
478 | 471 | <a |
479 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
472 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
480 | 473 | >gchar</a> *proto, |
481 | 474 | <a |
482 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
475 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
483 | 476 | >gchar</a> *external_ip, |
484 | 477 | <a |
485 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
478 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
486 | 479 | >gchar</a> *replaces_external_ip, |
487 | 480 | <a |
488 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" | |
481 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint" | |
489 | 482 | >guint</a> external_port, |
490 | 483 | <a |
491 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
484 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
492 | 485 | >gchar</a> *local_ip, |
493 | 486 | <a |
494 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" | |
487 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint" | |
495 | 488 | >guint</a> local_port, |
496 | 489 | <a |
497 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" | |
490 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar" | |
498 | 491 | >gchar</a> *description, |
499 | 492 | <a |
500 | href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" | |
493 | href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer" | |
501 | 494 | >gpointer</a> user_data) : Run Last</pre> |
502 | 495 | <p> |
503 | 496 | This signal means that an IGD has been found that that adding a port |
504 | 497 | mapping has succeeded.</p> |
505 | 498 | <p> |
506 | ||
507 | 499 | </p> |
508 | 500 | <div class="variablelist"><table border="0"> |
509 | 501 | <col align="left" valign="top"> |
560 | 552 | </div> |
561 | 553 | <div class="footer"> |
562 | 554 | <hr> |
563 | Generated by GTK-Doc V1.10</div> | |
555 | Generated by GTK-Doc V1.11</div> | |
564 | 556 | </body> |
565 | 557 | </html> |
6 | 6 | <link rel="start" href="index.html" title="GUPnP IGD Reference Manual"> |
7 | 7 | <link rel="up" href="ch01.html" title="Simple IGD module"> |
8 | 8 | <link rel="prev" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd"> |
9 | <meta name="generator" content="GTK-Doc V1.10 (XML mode)"> | |
9 | <meta name="generator" content="GTK-Doc V1.11 (XML mode)"> | |
10 | 10 | <link rel="stylesheet" href="style.css" type="text/css"> |
11 | 11 | <link rel="chapter" href="ch01.html" title="Simple IGD module"> |
12 | 12 | </head> |
19 | 19 | <th width="100%" align="center">GUPnP IGD Reference Manual</th> |
20 | 20 | <td>Â </td> |
21 | 21 | </tr> |
22 | <tr><td colspan="5" class="shortcuts"><nobr><a href="#GUPnPSimpleIgdThread.synopsis" class="shortcut">Top</a> | |
23 | Â |Â | |
24 | <a href="#GUPnPSimpleIgdThread.description" class="shortcut">Description</a> | |
25 | Â |Â | |
26 | <a href="#GUPnPSimpleIgdThread.object-hierarchy" class="shortcut">Object Hierarchy</a></nobr></td></tr> | |
22 | <tr><td colspan="5" class="shortcuts"> | |
23 | <a href="#GUPnPSimpleIgdThread.synopsis" class="shortcut">Top</a> | |
24 | Â |Â | |
25 | <a href="#GUPnPSimpleIgdThread.description" class="shortcut">Description</a> | |
26 | Â |Â | |
27 | <a href="#GUPnPSimpleIgdThread.object-hierarchy" class="shortcut">Object Hierarchy</a> | |
28 | </td></tr> | |
27 | 29 | </table> |
28 | 30 | <div class="refentry" lang="en"> |
29 | 31 | <a name="GUPnPSimpleIgdThread"></a><div class="titlepage"></div> |
39 | 41 | <pre class="synopsis"> |
40 | 42 | <a class="link" href="GUPnPSimpleIgdThread.html#GUPnPSimpleIgdThread-struct" title="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</a>; |
41 | 43 | <a class="link" href="GUPnPSimpleIgdThread.html#GUPnPSimpleIgdThreadClass" title="GUPnPSimpleIgdThreadClass">GUPnPSimpleIgdThreadClass</a>; |
42 | <a class="link" href="GUPnPSimpleIgdThread.html" title="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</a>* <a class="link" href="GUPnPSimpleIgdThread.html#gupnp-simple-igd-thread-new" title="gupnp_simple_igd_thread_new ()">gupnp_simple_igd_thread_new</a> (void); | |
44 | <a class="link" href="GUPnPSimpleIgdThread.html" title="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</a> * <a class="link" href="GUPnPSimpleIgdThread.html#gupnp-simple-igd-thread-new" title="gupnp_simple_igd_thread_new ()">gupnp_simple_igd_thread_new</a> (void); | |
43 | 45 | </pre> |
44 | 46 | </div> |
45 | 47 | <div class="refsect1" lang="en"> |
46 | 48 | <a name="GUPnPSimpleIgdThread.object-hierarchy"></a><h2>Object Hierarchy</h2> |
47 | 49 | <pre class="synopsis"> |
48 | 50 | <a |
49 | href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject" | |
51 | href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject" | |
50 | 52 | >GObject</a> |
51 | 53 | +----<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> |
52 | 54 | +----GUPnPSimpleIgdThread |
57 | 59 | <p> |
58 | 60 | This wraps a <a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd"><span class="type">GUPnPSimpleIgd</span></a> into a thread so that it can be used without |
59 | 61 | having a <a |
60 | href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GMainLoop" | |
62 | href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainLoop" | |
61 | 63 | ><span class="type">GMainLoop</span></a> running.</p> |
62 | 64 | <p> |
63 | ||
64 | 65 | </p> |
65 | 66 | </div> |
66 | 67 | <div class="refsect1" lang="en"> |
71 | 72 | <p> |
72 | 73 | All members are private, access them using methods and properties</p> |
73 | 74 | <p> |
74 | ||
75 | 75 | </p> |
76 | 76 | </div> |
77 | 77 | <hr> |
86 | 86 | <p> |
87 | 87 | The Raw UDP component transmitter class</p> |
88 | 88 | <p> |
89 | ||
90 | 89 | </p> |
91 | 90 | <div class="variablelist"><table border="0"> |
92 | 91 | <col align="left" valign="top"> |
100 | 99 | <hr> |
101 | 100 | <div class="refsect2" lang="en"> |
102 | 101 | <a name="gupnp-simple-igd-thread-new"></a><h3>gupnp_simple_igd_thread_new ()</h3> |
103 | <pre class="programlisting"><a class="link" href="GUPnPSimpleIgdThread.html" title="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</a>* gupnp_simple_igd_thread_new (void);</pre> | |
102 | <pre class="programlisting"><a class="link" href="GUPnPSimpleIgdThread.html" title="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</a> * gupnp_simple_igd_thread_new (void);</pre> | |
104 | 103 | <p> |
105 | 104 | Creates a new <a class="link" href="GUPnPSimpleIgdThread.html" title="GUPnPSimpleIgdThread"><span class="type">GUPnPSimpleIgdThread</span></a></p> |
106 | 105 | <p> |
107 | ||
108 | 106 | </p> |
109 | 107 | <div class="variablelist"><table border="0"> |
110 | 108 | <col align="left" valign="top"> |
119 | 117 | </div> |
120 | 118 | <div class="footer"> |
121 | 119 | <hr> |
122 | Generated by GTK-Doc V1.10</div> | |
120 | Generated by GTK-Doc V1.11</div> | |
123 | 121 | </body> |
124 | 122 | </html> |
7 | 7 | <link rel="up" href="index.html" title="GUPnP IGD Reference Manual"> |
8 | 8 | <link rel="prev" href="index.html" title="GUPnP IGD Reference Manual"> |
9 | 9 | <link rel="next" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd"> |
10 | <meta name="generator" content="GTK-Doc V1.10 (XML mode)"> | |
10 | <meta name="generator" content="GTK-Doc V1.11 (XML mode)"> | |
11 | 11 | <link rel="stylesheet" href="style.css" type="text/css"> |
12 | 12 | <link rel="chapter" href="ch01.html" title="Simple IGD module"> |
13 | 13 | </head> |
21 | 21 | </tr></table> |
22 | 22 | <div class="chapter" lang="en"> |
23 | 23 | <div class="titlepage"><div><div><h2 class="title"> |
24 | <a name="id3041306"></a>Simple IGD module</h2></div></div></div> | |
24 | <a name="id2555198"></a>Simple IGD module</h2></div></div></div> | |
25 | 25 | <div class="toc"><dl> |
26 | 26 | <dt> |
27 | 27 | <span class="refentrytitle"><a href="GUPnPSimpleIgd.html">GUPnPSimpleIgd</a></span><span class="refpurpose"> — A simple class to map ports on UPnP routers</span> |
33 | 33 | </div> |
34 | 34 | <div class="footer"> |
35 | 35 | <hr> |
36 | Generated by GTK-Doc V1.10</div> | |
36 | Generated by GTK-Doc V1.11</div> | |
37 | 37 | </body> |
38 | 38 | </html> |
9 | 9 | <functions> |
10 | 10 | <function name="GUPnPSimpleIgd" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-struct"/> |
11 | 11 | <function name="GUPnPSimpleIgdClass" link="GUPnPSimpleIgd.html#GUPnPSimpleIgdClass"/> |
12 | <function name="GUPNP_SIMPLE_IGD_ERROR" link="GUPnPSimpleIgd.html#GUPNP-SIMPLE-IGD-ERROR:CAPS"/> | |
12 | <function name="GUPNP_SIMPLE_IGD_ERROR" link="GUPnPSimpleIgd.html#GUPNP-SIMPLE-IGD-ERROR--CAPS"/> | |
13 | 13 | <function name="enum GUPnPSimpleIgdError" link="GUPnPSimpleIgd.html#GUPnPSimpleIgdError"/> |
14 | 14 | <function name="gupnp_simple_igd_new ()" link="GUPnPSimpleIgd.html#gupnp-simple-igd-new"/> |
15 | 15 | <function name="gupnp_simple_igd_add_port ()" link="GUPnPSimpleIgd.html#gupnp-simple-igd-add-port"/> |
0 | 0 | <?xml version="1.0" encoding="utf-8" standalone="no"?> |
1 | 1 | <!DOCTYPE book PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ""> |
2 | <book xmlns="http://www.devhelp.net/book" title="GUPnP IGD Reference Manual" link="index.html" author="" name="gupnp-igd" version="2"> | |
2 | <book xmlns="http://www.devhelp.net/book" title="GUPnP IGD Reference Manual" link="index.html" author="" name="gupnp-igd" version="2" language="c"> | |
3 | 3 | <chapters> |
4 | 4 | <sub name="Simple IGD module" link="ch01.html"> |
5 | 5 | <sub name="GUPnPSimpleIgd" link="GUPnPSimpleIgd.html"/> |
9 | 9 | <functions> |
10 | 10 | <keyword type="struct" name="GUPnPSimpleIgd" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-struct"/> |
11 | 11 | <keyword type="struct" name="GUPnPSimpleIgdClass" link="GUPnPSimpleIgd.html#GUPnPSimpleIgdClass"/> |
12 | <keyword type="macro" name="GUPNP_SIMPLE_IGD_ERROR" link="GUPnPSimpleIgd.html#GUPNP-SIMPLE-IGD-ERROR:CAPS"/> | |
12 | <keyword type="macro" name="GUPNP_SIMPLE_IGD_ERROR" link="GUPnPSimpleIgd.html#GUPNP-SIMPLE-IGD-ERROR--CAPS"/> | |
13 | 13 | <keyword type="enum" name="enum GUPnPSimpleIgdError" link="GUPnPSimpleIgd.html#GUPnPSimpleIgdError"/> |
14 | 14 | <keyword type="function" name="gupnp_simple_igd_new ()" link="GUPnPSimpleIgd.html#gupnp-simple-igd-new"/> |
15 | 15 | <keyword type="function" name="gupnp_simple_igd_add_port ()" link="GUPnPSimpleIgd.html#gupnp-simple-igd-add-port"/> |
16 | 16 | <keyword type="function" name="gupnp_simple_igd_remove_port ()" link="GUPnPSimpleIgd.html#gupnp-simple-igd-remove-port"/> |
17 | <keyword type="" name="The "main-context" property" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd--main-context"/> | |
18 | <keyword type="" name="The "request-timeout" property" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd--request-timeout"/> | |
19 | <keyword type="" name="The "error-mapping-port" signal" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-error-mapping-port"/> | |
20 | <keyword type="" name="The "mapped-external-port" signal" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-mapped-external-port"/> | |
17 | <keyword type="property" name="The "main-context" property" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd--main-context"/> | |
18 | <keyword type="property" name="The "request-timeout" property" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd--request-timeout"/> | |
19 | <keyword type="signal" name="The "error-mapping-port" signal" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-error-mapping-port"/> | |
20 | <keyword type="signal" name="The "mapped-external-port" signal" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-mapped-external-port"/> | |
21 | 21 | <keyword type="struct" name="GUPnPSimpleIgdThread" link="GUPnPSimpleIgdThread.html#GUPnPSimpleIgdThread-struct"/> |
22 | 22 | <keyword type="struct" name="GUPnPSimpleIgdThreadClass" link="GUPnPSimpleIgdThread.html#GUPnPSimpleIgdThreadClass"/> |
23 | 23 | <keyword type="function" name="gupnp_simple_igd_thread_new ()" link="GUPnPSimpleIgdThread.html#gupnp-simple-igd-thread-new"/> |
24 | <keyword type="constant" name="GUPNP_SIMPLE_IGD_ERROR_EXTERNAL_ADDRESS" link="GUPnPSimpleIgd.html#GUPNP-SIMPLE-IGD-ERROR-EXTERNAL-ADDRESS--CAPS"/> | |
24 | 25 | </functions> |
25 | 26 | </book> |
5 | 5 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2"> |
6 | 6 | <link rel="start" href="index.html" title="GUPnP IGD Reference Manual"> |
7 | 7 | <link rel="next" href="ch01.html" title="Simple IGD module"> |
8 | <meta name="generator" content="GTK-Doc V1.10 (XML mode)"> | |
8 | <meta name="generator" content="GTK-Doc V1.11 (XML mode)"> | |
9 | 9 | <link rel="stylesheet" href="style.css" type="text/css"> |
10 | 10 | <link rel="chapter" href="ch01.html" title="Simple IGD module"> |
11 | 11 | </head> |
15 | 15 | <div> |
16 | 16 | <div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">GUPnP IGD Reference Manual</p></th></tr></table></div> |
17 | 17 | <div><p class="releaseinfo"> |
18 | for gupnp-igd 0.1.1 | |
18 | for gupnp-igd 0.1.3 | |
19 | 19 | |
20 | 20 | </p></div> |
21 | 21 | <div><p class="copyright">Copyright © 2008 Collabora Ltd, Nokia Corp</p></div> |
36 | 36 | </div> |
37 | 37 | <div class="footer"> |
38 | 38 | <hr> |
39 | Generated by GTK-Doc V1.10</div> | |
39 | Generated by GTK-Doc V1.11</div> | |
40 | 40 | </body> |
41 | 41 | </html> |
6 | 6 | <ANCHOR id="GUPnPSimpleIgd.details" href="gupnp-igd/GUPnPSimpleIgd.html#GUPnPSimpleIgd.details"> |
7 | 7 | <ANCHOR id="GUPnPSimpleIgd-struct" href="gupnp-igd/GUPnPSimpleIgd.html#GUPnPSimpleIgd-struct"> |
8 | 8 | <ANCHOR id="GUPnPSimpleIgdClass" href="gupnp-igd/GUPnPSimpleIgd.html#GUPnPSimpleIgdClass"> |
9 | <ANCHOR id="GUPNP-SIMPLE-IGD-ERROR:CAPS" href="gupnp-igd/GUPnPSimpleIgd.html#GUPNP-SIMPLE-IGD-ERROR:CAPS"> | |
9 | <ANCHOR id="GUPNP-SIMPLE-IGD-ERROR--CAPS" href="gupnp-igd/GUPnPSimpleIgd.html#GUPNP-SIMPLE-IGD-ERROR--CAPS"> | |
10 | 10 | <ANCHOR id="GUPnPSimpleIgdError" href="gupnp-igd/GUPnPSimpleIgd.html#GUPnPSimpleIgdError"> |
11 | 11 | <ANCHOR id="gupnp-simple-igd-new" href="gupnp-igd/GUPnPSimpleIgd.html#gupnp-simple-igd-new"> |
12 | 12 | <ANCHOR id="gupnp-simple-igd-add-port" href="gupnp-igd/GUPnPSimpleIgd.html#gupnp-simple-igd-add-port"> |
55 | 55 | { |
56 | 56 | color: #770000; |
57 | 57 | font-size: 80%; |
58 | white-space: nowrap; | |
58 | 59 | } |
59 | div.refentry, div.chapter, div.reference, div.part, div.book, div.index, div.glossary, div.sect1, div.appendix, div.preface | |
60 | div.refentry, div.chapter, div.reference, div.part, div.book, div.glossary, div.sect1, div.appendix, div.preface | |
60 | 61 | { |
61 | 62 | position: relative; |
62 | 63 | top: 3em; |
64 | z-index: 0; | |
65 | } | |
66 | div.glossary, div.index | |
67 | { | |
68 | position: relative; | |
69 | top: 2em; | |
63 | 70 | z-index: 0; |
64 | 71 | } |
65 | 72 | div.refnamediv |
0 | <?xml version="1.0"?> | |
1 | <!DOCTYPE indexdiv PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | |
2 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ | |
3 | <!ENTITY version SYSTEM "version.xml"> | |
4 | ]> | |
5 | <indexdiv> | |
6 | </indexdiv> |
0 | <?xml version="1.0"?> | |
1 | <!DOCTYPE indexdiv PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | |
2 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ | |
3 | <!ENTITY version SYSTEM "version.xml"> | |
4 | ]> | |
5 | <indexdiv> | |
6 | <indexdiv><title>G</title> | |
7 | <indexentry><primaryie linkends="GUPnPSimpleIgd-struct"><link linkend="GUPnPSimpleIgd-struct">GUPnPSimpleIgd</link></primaryie></indexentry> | |
8 | <indexentry><primaryie linkends="GUPnPSimpleIgd-error-mapping-port"><link linkend="GUPnPSimpleIgd-error-mapping-port">GUPnPSimpleIgd::error-mapping-port</link></primaryie></indexentry> | |
9 | <indexentry><primaryie linkends="GUPnPSimpleIgd-mapped-external-port"><link linkend="GUPnPSimpleIgd-mapped-external-port">GUPnPSimpleIgd::mapped-external-port</link></primaryie></indexentry> | |
10 | <indexentry><primaryie linkends="GUPnPSimpleIgd--main-context"><link linkend="GUPnPSimpleIgd--main-context">GUPnPSimpleIgd:main-context</link></primaryie></indexentry> | |
11 | <indexentry><primaryie linkends="GUPnPSimpleIgd--request-timeout"><link linkend="GUPnPSimpleIgd--request-timeout">GUPnPSimpleIgd:request-timeout</link></primaryie></indexentry> | |
12 | <indexentry><primaryie linkends="GUPnPSimpleIgdClass"><link linkend="GUPnPSimpleIgdClass">GUPnPSimpleIgdClass</link></primaryie></indexentry> | |
13 | <indexentry><primaryie linkends="GUPnPSimpleIgdError"><link linkend="GUPnPSimpleIgdError">GUPnPSimpleIgdError</link></primaryie></indexentry> | |
14 | <indexentry><primaryie linkends="GUPnPSimpleIgdThread-struct"><link linkend="GUPnPSimpleIgdThread-struct">GUPnPSimpleIgdThread</link></primaryie></indexentry> | |
15 | <indexentry><primaryie linkends="GUPnPSimpleIgdThreadClass"><link linkend="GUPnPSimpleIgdThreadClass">GUPnPSimpleIgdThreadClass</link></primaryie></indexentry> | |
16 | <indexentry><primaryie linkends="gupnp-simple-igd-add-port"><link linkend="gupnp-simple-igd-add-port">gupnp_simple_igd_add_port</link></primaryie></indexentry> | |
17 | <indexentry><primaryie linkends="GUPNP-SIMPLE-IGD-ERROR--CAPS"><link linkend="GUPNP-SIMPLE-IGD-ERROR--CAPS">GUPNP_SIMPLE_IGD_ERROR</link></primaryie></indexentry> | |
18 | <indexentry><primaryie linkends="gupnp-simple-igd-new"><link linkend="gupnp-simple-igd-new">gupnp_simple_igd_new</link></primaryie></indexentry> | |
19 | <indexentry><primaryie linkends="gupnp-simple-igd-remove-port"><link linkend="gupnp-simple-igd-remove-port">gupnp_simple_igd_remove_port</link></primaryie></indexentry> | |
20 | <indexentry><primaryie linkends="gupnp-simple-igd-thread-new"><link linkend="gupnp-simple-igd-thread-new">gupnp_simple_igd_thread_new</link></primaryie></indexentry> | |
21 | </indexdiv> | |
22 | </indexdiv> |
12 | 12 | <refnamediv> |
13 | 13 | <refname>GUPnPSimpleIgdThread</refname> |
14 | 14 | <refpurpose>Threaded wrapper for GUPnPSimpleIgd</refpurpose> |
15 | <!--[<xref linkend="desc" endterm="desc.title"/>]--> | |
16 | 15 | </refnamediv> |
17 | 16 | |
18 | 17 | <refsynopsisdiv id="GUPnPSimpleIgdThread.synopsis" role="synopsis"> |
21 | 20 | <synopsis> |
22 | 21 | <link linkend="GUPnPSimpleIgdThread-struct">GUPnPSimpleIgdThread</link>; |
23 | 22 | <link linkend="GUPnPSimpleIgdThreadClass">GUPnPSimpleIgdThreadClass</link>; |
24 | <link linkend="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</link>* <link linkend="gupnp-simple-igd-thread-new">gupnp_simple_igd_thread_new</link> (void); | |
23 | <link linkend="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</link> * <link linkend="gupnp-simple-igd-thread-new">gupnp_simple_igd_thread_new</link> (void); | |
25 | 24 | </synopsis> |
26 | 25 | </refsynopsisdiv> |
27 | 26 | |
32 | 31 | +----<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> |
33 | 32 | +----GUPnPSimpleIgdThread |
34 | 33 | </synopsis> |
35 | ||
36 | 34 | </refsect1> |
37 | 35 | |
38 | 36 | |
48 | 46 | This wraps a <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> into a thread so that it can be used without |
49 | 47 | having a <link linkend="GMainLoop"><type>GMainLoop</type></link> running.</para> |
50 | 48 | <para> |
51 | ||
52 | 49 | </para> |
53 | 50 | </refsect1> |
54 | 51 | |
56 | 53 | <title role="details.title">Details</title> |
57 | 54 | <refsect2 id="GUPnPSimpleIgdThread-struct" role="struct"> |
58 | 55 | <title>GUPnPSimpleIgdThread</title> |
59 | <indexterm zone="GUPnPSimpleIgdThread-struct"><primary>GUPnPSimpleIgdThread</primary></indexterm><programlisting>typedef struct _GUPnPSimpleIgdThread GUPnPSimpleIgdThread;</programlisting> | |
56 | <indexterm zone="GUPnPSimpleIgdThread-struct"><primary sortas="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</primary></indexterm><programlisting>typedef struct _GUPnPSimpleIgdThread GUPnPSimpleIgdThread;</programlisting> | |
60 | 57 | <para> |
61 | 58 | All members are private, access them using methods and properties</para> |
62 | 59 | <para> |
63 | ||
64 | 60 | </para></refsect2> |
65 | 61 | <refsect2 id="GUPnPSimpleIgdThreadClass" role="struct"> |
66 | 62 | <title>GUPnPSimpleIgdThreadClass</title> |
67 | <indexterm zone="GUPnPSimpleIgdThreadClass"><primary>GUPnPSimpleIgdThreadClass</primary></indexterm><programlisting>typedef struct { | |
63 | <indexterm zone="GUPnPSimpleIgdThreadClass"><primary sortas="GUPnPSimpleIgdThreadClass">GUPnPSimpleIgdThreadClass</primary></indexterm><programlisting>typedef struct { | |
68 | 64 | GUPnPSimpleIgdClass parent_class; |
69 | 65 | |
70 | 66 | /*virtual functions */ |
73 | 69 | <para> |
74 | 70 | The Raw UDP component transmitter class</para> |
75 | 71 | <para> |
76 | ||
77 | 72 | </para><variablelist role="struct"> |
78 | 73 | <varlistentry> |
79 | <term><link linkend="GUPnPSimpleIgdClass">GUPnPSimpleIgdClass</link> <structfield>parent_class</structfield>;</term> | |
74 | <term><link linkend="GUPnPSimpleIgdClass">GUPnPSimpleIgdClass</link> <structfield>parent_class</structfield>;</term> | |
80 | 75 | <listitem><simpara> Our parent |
81 | 76 | </simpara></listitem> |
82 | 77 | </varlistentry> |
83 | 78 | </variablelist></refsect2> |
84 | 79 | <refsect2 id="gupnp-simple-igd-thread-new" role="function"> |
85 | 80 | <title>gupnp_simple_igd_thread_new ()</title> |
86 | <indexterm zone="gupnp-simple-igd-thread-new"><primary>gupnp_simple_igd_thread_new</primary></indexterm><programlisting><link linkend="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</link>* gupnp_simple_igd_thread_new (void);</programlisting> | |
81 | <indexterm zone="gupnp-simple-igd-thread-new"><primary sortas="gupnp_simple_igd_thread_new">gupnp_simple_igd_thread_new</primary></indexterm><programlisting><link linkend="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</link> * gupnp_simple_igd_thread_new (void);</programlisting> | |
87 | 82 | <para> |
88 | 83 | Creates a new <link linkend="GUPnPSimpleIgdThread"><type>GUPnPSimpleIgdThread</type></link></para> |
89 | 84 | <para> |
90 | ||
91 | 85 | </para><variablelist role="params"> |
92 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new <link linkend="GUPnPSimpleIgdThread"><type>GUPnPSimpleIgdThread</type></link> | |
86 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new <link linkend="GUPnPSimpleIgdThread"><type>GUPnPSimpleIgdThread</type></link> | |
93 | 87 | </simpara></listitem></varlistentry> |
94 | 88 | </variablelist></refsect2> |
95 | 89 |
12 | 12 | <refnamediv> |
13 | 13 | <refname>GUPnPSimpleIgd</refname> |
14 | 14 | <refpurpose>A simple class to map ports on UPnP routers</refpurpose> |
15 | <!--[<xref linkend="desc" endterm="desc.title"/>]--> | |
16 | 15 | </refnamediv> |
17 | 16 | |
18 | 17 | <refsynopsisdiv id="GUPnPSimpleIgd.synopsis" role="synopsis"> |
21 | 20 | <synopsis> |
22 | 21 | <link linkend="GUPnPSimpleIgd-struct">GUPnPSimpleIgd</link>; |
23 | 22 | <link linkend="GUPnPSimpleIgdClass">GUPnPSimpleIgdClass</link>; |
24 | #define <link linkend="GUPNP-SIMPLE-IGD-ERROR:CAPS">GUPNP_SIMPLE_IGD_ERROR</link> | |
23 | #define <link linkend="GUPNP-SIMPLE-IGD-ERROR--CAPS">GUPNP_SIMPLE_IGD_ERROR</link> | |
25 | 24 | enum <link linkend="GUPnPSimpleIgdError">GUPnPSimpleIgdError</link>; |
26 | <link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link>* <link linkend="gupnp-simple-igd-new">gupnp_simple_igd_new</link> (<link linkend="GMainContext">GMainContext</link> *main_context); | |
25 | <link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> * <link linkend="gupnp-simple-igd-new">gupnp_simple_igd_new</link> (<link linkend="GMainContext">GMainContext</link> *main_context); | |
27 | 26 | <link linkend="void">void</link> <link linkend="gupnp-simple-igd-add-port">gupnp_simple_igd_add_port</link> (<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> *self, |
28 | 27 | const <link linkend="gchar">gchar</link> *protocol, |
29 | 28 | <link linkend="guint16">guint16</link> external_port, |
44 | 43 | +----GUPnPSimpleIgd |
45 | 44 | +----<link linkend="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</link> |
46 | 45 | </synopsis> |
47 | ||
48 | 46 | </refsect1> |
49 | 47 | |
50 | 48 | |
76 | 74 | It also allows implementations to know the external port from the router's |
77 | 75 | perspective.</para> |
78 | 76 | <para> |
79 | ||
80 | 77 | </para> |
81 | 78 | </refsect1> |
82 | 79 | |
84 | 81 | <title role="details.title">Details</title> |
85 | 82 | <refsect2 id="GUPnPSimpleIgd-struct" role="struct"> |
86 | 83 | <title>GUPnPSimpleIgd</title> |
87 | <indexterm zone="GUPnPSimpleIgd-struct"><primary>GUPnPSimpleIgd</primary></indexterm><programlisting>typedef struct _GUPnPSimpleIgd GUPnPSimpleIgd;</programlisting> | |
84 | <indexterm zone="GUPnPSimpleIgd-struct"><primary sortas="GUPnPSimpleIgd">GUPnPSimpleIgd</primary></indexterm><programlisting>typedef struct _GUPnPSimpleIgd GUPnPSimpleIgd;</programlisting> | |
88 | 85 | <para> |
89 | 86 | All members are private, access them using methods and properties</para> |
90 | 87 | <para> |
91 | ||
92 | 88 | </para></refsect2> |
93 | 89 | <refsect2 id="GUPnPSimpleIgdClass" role="struct"> |
94 | 90 | <title>GUPnPSimpleIgdClass</title> |
95 | <indexterm zone="GUPnPSimpleIgdClass"><primary>GUPnPSimpleIgdClass</primary></indexterm><programlisting>typedef struct { | |
91 | <indexterm zone="GUPnPSimpleIgdClass"><primary sortas="GUPnPSimpleIgdClass">GUPnPSimpleIgdClass</primary></indexterm><programlisting>typedef struct { | |
96 | 92 | GObjectClass parent_class; |
97 | 93 | |
98 | 94 | /*virtual functions */ |
113 | 109 | <para> |
114 | 110 | The Raw UDP component transmitter class</para> |
115 | 111 | <para> |
116 | ||
117 | 112 | </para><variablelist role="struct"> |
118 | 113 | <varlistentry> |
119 | <term><link linkend="GObjectClass">GObjectClass</link> <structfield>parent_class</structfield>;</term> | |
114 | <term><link linkend="GObjectClass">GObjectClass</link> <structfield>parent_class</structfield>;</term> | |
120 | 115 | <listitem><simpara> Our parent |
121 | 116 | </simpara></listitem> |
122 | 117 | </varlistentry> |
123 | 118 | <varlistentry> |
124 | <term><structfield>add_port</structfield> ()</term> | |
119 | <term><structfield>add_port</structfield> ()</term> | |
125 | 120 | <listitem><simpara> An implementation of the add_port function |
126 | 121 | </simpara></listitem> |
127 | 122 | </varlistentry> |
128 | 123 | <varlistentry> |
129 | <term><structfield>remove_port</structfield> ()</term> | |
124 | <term><structfield>remove_port</structfield> ()</term> | |
130 | 125 | <listitem><simpara> An implementation of the delete_port function |
131 | 126 | </simpara></listitem> |
132 | 127 | </varlistentry> |
133 | 128 | </variablelist></refsect2> |
134 | <refsect2 id="GUPNP-SIMPLE-IGD-ERROR:CAPS" role="macro"> | |
129 | <refsect2 id="GUPNP-SIMPLE-IGD-ERROR--CAPS" role="macro"> | |
135 | 130 | <title>GUPNP_SIMPLE_IGD_ERROR</title> |
136 | <indexterm zone="GUPNP-SIMPLE-IGD-ERROR:CAPS"><primary>GUPNP_SIMPLE_IGD_ERROR</primary></indexterm><programlisting>#define GUPNP_SIMPLE_IGD_ERROR (gupnp_simple_igd_get_error_domain ()) | |
131 | <indexterm zone="GUPNP-SIMPLE-IGD-ERROR--CAPS"><primary sortas="GUPNP_SIMPLE_IGD_ERROR">GUPNP_SIMPLE_IGD_ERROR</primary></indexterm><programlisting>#define GUPNP_SIMPLE_IGD_ERROR (gupnp_simple_igd_get_error_domain ()) | |
137 | 132 | </programlisting> |
138 | 133 | <para> |
139 | 134 | The <link linkend="GError"><type>GError</type></link> domain for error coming out of GUPnpSimpleIGD</para> |
140 | 135 | <para> |
141 | ||
142 | 136 | </para></refsect2> |
143 | 137 | <refsect2 id="GUPnPSimpleIgdError" role="enum"> |
144 | 138 | <title>enum GUPnPSimpleIgdError</title> |
145 | <indexterm zone="GUPnPSimpleIgdError"><primary>GUPnPSimpleIgdError</primary></indexterm><programlisting>typedef enum { | |
139 | <indexterm zone="GUPnPSimpleIgdError"><primary sortas="GUPnPSimpleIgdError">GUPnPSimpleIgdError</primary></indexterm><programlisting>typedef enum { | |
146 | 140 | GUPNP_SIMPLE_IGD_ERROR_EXTERNAL_ADDRESS, |
147 | 141 | } GUPnPSimpleIgdError; |
148 | 142 | </programlisting> |
149 | 143 | <para> |
150 | 144 | Errors coming out of the GUPnPSimpleIGD object.</para> |
151 | 145 | <para> |
152 | ||
153 | 146 | </para><variablelist role="enum"> |
154 | <varlistentry id="GUPNP-SIMPLE-IGD-ERROR-EXTERNAL-ADDRESS:CAPS" role="constant"> | |
147 | <varlistentry id="GUPNP-SIMPLE-IGD-ERROR-EXTERNAL-ADDRESS--CAPS" role="constant"> | |
155 | 148 | <term><literal>GUPNP_SIMPLE_IGD_ERROR_EXTERNAL_ADDRESS</literal></term> |
156 | 149 | <listitem><simpara> Error getting the external |
157 | 150 | address of the router |
160 | 153 | </variablelist></refsect2> |
161 | 154 | <refsect2 id="gupnp-simple-igd-new" role="function"> |
162 | 155 | <title>gupnp_simple_igd_new ()</title> |
163 | <indexterm zone="gupnp-simple-igd-new"><primary>gupnp_simple_igd_new</primary></indexterm><programlisting><link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link>* gupnp_simple_igd_new (<link linkend="GMainContext">GMainContext</link> *main_context);</programlisting> | |
156 | <indexterm zone="gupnp-simple-igd-new"><primary sortas="gupnp_simple_igd_new">gupnp_simple_igd_new</primary></indexterm><programlisting><link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> * gupnp_simple_igd_new (<link linkend="GMainContext">GMainContext</link> *main_context);</programlisting> | |
164 | 157 | <para> |
165 | 158 | This creates a new <link linkend="GUPnpSimpleIgd"><type>GUPnpSimpleIgd</type></link> object using the special GMainContext</para> |
166 | 159 | <para> |
167 | ||
168 | </para><variablelist role="params"> | |
169 | <varlistentry><term><parameter>main_context</parameter> :</term> | |
160 | </para><variablelist role="params"> | |
161 | <varlistentry><term><parameter>main_context</parameter> :</term> | |
170 | 162 | <listitem><simpara> the <link linkend="GMainContext"><type>GMainContext</type></link> to use (may be NULL for the default |
171 | 163 | main context) |
172 | 164 | </simpara></listitem></varlistentry> |
173 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> | |
165 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> | |
174 | 166 | </simpara></listitem></varlistentry> |
175 | 167 | </variablelist></refsect2> |
176 | 168 | <refsect2 id="gupnp-simple-igd-add-port" role="function"> |
177 | 169 | <title>gupnp_simple_igd_add_port ()</title> |
178 | <indexterm zone="gupnp-simple-igd-add-port"><primary>gupnp_simple_igd_add_port</primary></indexterm><programlisting><link linkend="void">void</link> gupnp_simple_igd_add_port (<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> *self, | |
170 | <indexterm zone="gupnp-simple-igd-add-port"><primary sortas="gupnp_simple_igd_add_port">gupnp_simple_igd_add_port</primary></indexterm><programlisting><link linkend="void">void</link> gupnp_simple_igd_add_port (<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> *self, | |
179 | 171 | const <link linkend="gchar">gchar</link> *protocol, |
180 | 172 | <link linkend="guint16">guint16</link> external_port, |
181 | 173 | const <link linkend="gchar">gchar</link> *local_ip, |
193 | 185 | <link linkend="GUPnPSimpleIgd-mapped-external-port"><type>"mapped-external-port"</type></link> will be emitted. These signals may |
194 | 186 | be emitted multiple times if there are multiple routers present.</para> |
195 | 187 | <para> |
196 | ||
197 | </para><variablelist role="params"> | |
198 | <varlistentry><term><parameter>self</parameter> :</term> | |
188 | </para><variablelist role="params"> | |
189 | <varlistentry><term><parameter>self</parameter> :</term> | |
199 | 190 | <listitem><simpara> The <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> object |
200 | 191 | </simpara></listitem></varlistentry> |
201 | <varlistentry><term><parameter>protocol</parameter> :</term> | |
192 | <varlistentry><term><parameter>protocol</parameter> :</term> | |
202 | 193 | <listitem><simpara> the protocol "UDP" or "TCP" |
203 | 194 | </simpara></listitem></varlistentry> |
204 | <varlistentry><term><parameter>external_port</parameter> :</term> | |
195 | <varlistentry><term><parameter>external_port</parameter> :</term> | |
205 | 196 | <listitem><simpara> The port to try to open on the external device, |
206 | 197 | 0 means to try a random port if the same port as the local port is already |
207 | 198 | taken |
208 | 199 | </simpara></listitem></varlistentry> |
209 | <varlistentry><term><parameter>local_ip</parameter> :</term> | |
200 | <varlistentry><term><parameter>local_ip</parameter> :</term> | |
210 | 201 | <listitem><simpara> The IP address to forward packets to (most likely the local ip address) |
211 | 202 | </simpara></listitem></varlistentry> |
212 | <varlistentry><term><parameter>local_port</parameter> :</term> | |
203 | <varlistentry><term><parameter>local_port</parameter> :</term> | |
213 | 204 | <listitem><simpara> The local port to forward packets to |
214 | 205 | </simpara></listitem></varlistentry> |
215 | <varlistentry><term><parameter>lease_duration</parameter> :</term> | |
206 | <varlistentry><term><parameter>lease_duration</parameter> :</term> | |
216 | 207 | <listitem><simpara> The duration of the lease (it will be auto-renewed before it expires). This is in seconds. |
217 | 208 | </simpara></listitem></varlistentry> |
218 | <varlistentry><term><parameter>description</parameter> :</term> | |
209 | <varlistentry><term><parameter>description</parameter> :</term> | |
219 | 210 | <listitem><simpara> The description that will appear in the router's table |
220 | 211 | </simpara></listitem></varlistentry> |
221 | 212 | </variablelist></refsect2> |
222 | 213 | <refsect2 id="gupnp-simple-igd-remove-port" role="function"> |
223 | 214 | <title>gupnp_simple_igd_remove_port ()</title> |
224 | <indexterm zone="gupnp-simple-igd-remove-port"><primary>gupnp_simple_igd_remove_port</primary></indexterm><programlisting><link linkend="void">void</link> gupnp_simple_igd_remove_port (<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> *self, | |
215 | <indexterm zone="gupnp-simple-igd-remove-port"><primary sortas="gupnp_simple_igd_remove_port">gupnp_simple_igd_remove_port</primary></indexterm><programlisting><link linkend="void">void</link> gupnp_simple_igd_remove_port (<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> *self, | |
225 | 216 | const <link linkend="gchar">gchar</link> *protocol, |
226 | 217 | <link linkend="guint">guint</link> external_port);</programlisting> |
227 | 218 | <para> |
230 | 221 | it is a best effort mechanism. If it fails, the bindings will disapears after |
231 | 222 | the lease duration set when the port where added.</para> |
232 | 223 | <para> |
233 | ||
234 | </para><variablelist role="params"> | |
235 | <varlistentry><term><parameter>self</parameter> :</term> | |
224 | </para><variablelist role="params"> | |
225 | <varlistentry><term><parameter>self</parameter> :</term> | |
236 | 226 | <listitem><simpara> The <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> object |
237 | 227 | </simpara></listitem></varlistentry> |
238 | <varlistentry><term><parameter>protocol</parameter> :</term> | |
228 | <varlistentry><term><parameter>protocol</parameter> :</term> | |
239 | 229 | <listitem><simpara> the protocol "UDP" or "TCP" as given to |
240 | 230 | <link linkend="gupnp-simple-igd-add-port"><function>gupnp_simple_igd_add_port()</function></link> |
241 | 231 | </simpara></listitem></varlistentry> |
242 | <varlistentry><term><parameter>external_port</parameter> :</term> | |
232 | <varlistentry><term><parameter>external_port</parameter> :</term> | |
243 | 233 | <listitem><simpara> The port to try to open on the external device as given to |
244 | 234 | <link linkend="gupnp-simple-igd-add-port"><function>gupnp_simple_igd_add_port()</function></link> |
245 | 235 | </simpara></listitem></varlistentry> |
248 | 238 | </refsect1> |
249 | 239 | <refsect1 id="GUPnPSimpleIgd.property-details" role="property_details"> |
250 | 240 | <title role="property_details.title">Property Details</title> |
251 | <refsect2 id="GUPnPSimpleIgd--main-context"><title>The <literal>"main-context"</literal> property</title> | |
252 | <indexterm zone="GUPnPSimpleIgd--main-context"><primary>GUPnPSimpleIgd:main-context</primary></indexterm><programlisting> "main-context" <link linkend="gpointer">gpointer</link> : Read / Write / Construct Only</programlisting> | |
241 | <refsect2 id="GUPnPSimpleIgd--main-context" role="property"><title>The <literal>"main-context"</literal> property</title> | |
242 | <indexterm zone="GUPnPSimpleIgd--main-context"><primary sortas="GUPnPSimpleIgd:main-context">GUPnPSimpleIgd:main-context</primary></indexterm><programlisting> "main-context" <link linkend="gpointer">gpointer</link> : Read / Write / Construct Only</programlisting> | |
253 | 243 | <para>This GMainContext will be used for all async activities.</para></refsect2> |
254 | <refsect2 id="GUPnPSimpleIgd--request-timeout"><title>The <literal>"request-timeout"</literal> property</title> | |
255 | <indexterm zone="GUPnPSimpleIgd--request-timeout"><primary>GUPnPSimpleIgd:request-timeout</primary></indexterm><programlisting> "request-timeout" <link linkend="guint">guint</link> : Read / Write</programlisting> | |
244 | <refsect2 id="GUPnPSimpleIgd--request-timeout" role="property"><title>The <literal>"request-timeout"</literal> property</title> | |
245 | <indexterm zone="GUPnPSimpleIgd--request-timeout"><primary sortas="GUPnPSimpleIgd:request-timeout">GUPnPSimpleIgd:request-timeout</primary></indexterm><programlisting> "request-timeout" <link linkend="guint">guint</link> : Read / Write</programlisting> | |
256 | 246 | <para>After this timeout, the request is considered to have failed andis dropped (in seconds).</para><para>Default value: 5</para> |
257 | 247 | </refsect2> |
258 | ||
259 | 248 | </refsect1> |
260 | 249 | |
261 | 250 | <refsect1 id="GUPnPSimpleIgd.signal-details" role="signals"> |
262 | 251 | <title role="signals.title">Signal Details</title> |
263 | <refsect2 id="GUPnPSimpleIgd-error-mapping-port"><title>The <literal>"error-mapping-port"</literal> signal</title> | |
264 | <indexterm zone="GUPnPSimpleIgd-error-mapping-port"><primary>GUPnPSimpleIgd::error-mapping-port</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> *self, | |
252 | <refsect2 id="GUPnPSimpleIgd-error-mapping-port" role="signal"><title>The <literal>"error-mapping-port"</literal> signal</title> | |
253 | <indexterm zone="GUPnPSimpleIgd-error-mapping-port"><primary sortas="GUPnPSimpleIgd::error-mapping-port">GUPnPSimpleIgd::error-mapping-port</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> *self, | |
265 | 254 | <link linkend="gpointer">gpointer</link> error, |
266 | 255 | <link linkend="gchar">gchar</link> *proto, |
267 | 256 | <link linkend="guint">guint</link> external_port, |
273 | 262 | This means that mapping a port on a specific IGD has failed (it may still |
274 | 263 | succeed on other IGDs on the network).</para> |
275 | 264 | <para> |
276 | ||
277 | </para><variablelist role="params"> | |
278 | <varlistentry><term><parameter>self</parameter> :</term> | |
265 | </para><variablelist role="params"> | |
266 | <varlistentry><term><parameter>self</parameter> :</term> | |
279 | 267 | <listitem><simpara> <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> that emitted the signal |
280 | 268 | </simpara></listitem></varlistentry> |
281 | <varlistentry><term><parameter>error</parameter> :</term> | |
269 | <varlistentry><term><parameter>error</parameter> :</term> | |
282 | 270 | <listitem><simpara> a <link linkend="GError"><type>GError</type></link> |
283 | 271 | </simpara></listitem></varlistentry> |
284 | <varlistentry><term><parameter>proto</parameter> :</term> | |
272 | <varlistentry><term><parameter>proto</parameter> :</term> | |
285 | 273 | <listitem><simpara> The requested protocol |
286 | 274 | </simpara></listitem></varlistentry> |
287 | <varlistentry><term><parameter>external_port</parameter> :</term> | |
275 | <varlistentry><term><parameter>external_port</parameter> :</term> | |
288 | 276 | <listitem><simpara> the external port requested in <link linkend="gupnp-simple-igd-add-port"><function>gupnp_simple_igd_add_port()</function></link> |
289 | 277 | </simpara></listitem></varlistentry> |
290 | <varlistentry><term><parameter>local_ip</parameter> :</term> | |
278 | <varlistentry><term><parameter>local_ip</parameter> :</term> | |
291 | 279 | <listitem><simpara> internal ip this is forwarded to |
292 | 280 | </simpara></listitem></varlistentry> |
293 | <varlistentry><term><parameter>local_port</parameter> :</term> | |
281 | <varlistentry><term><parameter>local_port</parameter> :</term> | |
294 | 282 | <listitem><simpara> the local port |
295 | 283 | </simpara></listitem></varlistentry> |
296 | <varlistentry><term><parameter>description</parameter> :</term> | |
284 | <varlistentry><term><parameter>description</parameter> :</term> | |
297 | 285 | <listitem><simpara> the passed description |
298 | 286 | </simpara></listitem></varlistentry> |
299 | <varlistentry><term><parameter>user_data</parameter> :</term> | |
287 | <varlistentry><term><parameter>user_data</parameter> :</term> | |
300 | 288 | <listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry> |
301 | </variablelist></refsect2><refsect2 id="GUPnPSimpleIgd-mapped-external-port"><title>The <literal>"mapped-external-port"</literal> signal</title> | |
302 | <indexterm zone="GUPnPSimpleIgd-mapped-external-port"><primary>GUPnPSimpleIgd::mapped-external-port</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> *self, | |
289 | </variablelist></refsect2><refsect2 id="GUPnPSimpleIgd-mapped-external-port" role="signal"><title>The <literal>"mapped-external-port"</literal> signal</title> | |
290 | <indexterm zone="GUPnPSimpleIgd-mapped-external-port"><primary sortas="GUPnPSimpleIgd::mapped-external-port">GUPnPSimpleIgd::mapped-external-port</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> *self, | |
303 | 291 | <link linkend="gchar">gchar</link> *proto, |
304 | 292 | <link linkend="gchar">gchar</link> *external_ip, |
305 | 293 | <link linkend="gchar">gchar</link> *replaces_external_ip, |
312 | 300 | This signal means that an IGD has been found that that adding a port |
313 | 301 | mapping has succeeded.</para> |
314 | 302 | <para> |
315 | ||
316 | </para><variablelist role="params"> | |
317 | <varlistentry><term><parameter>self</parameter> :</term> | |
303 | </para><variablelist role="params"> | |
304 | <varlistentry><term><parameter>self</parameter> :</term> | |
318 | 305 | <listitem><simpara> <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> that emitted the signal |
319 | 306 | </simpara></listitem></varlistentry> |
320 | <varlistentry><term><parameter>proto</parameter> :</term> | |
307 | <varlistentry><term><parameter>proto</parameter> :</term> | |
321 | 308 | <listitem><simpara> the requested protocol ("UDP" or "TCP") |
322 | 309 | </simpara></listitem></varlistentry> |
323 | <varlistentry><term><parameter>external_ip</parameter> :</term> | |
310 | <varlistentry><term><parameter>external_ip</parameter> :</term> | |
324 | 311 | <listitem><simpara> the external IP |
325 | 312 | </simpara></listitem></varlistentry> |
326 | <varlistentry><term><parameter>replaces_external_ip</parameter> :</term> | |
313 | <varlistentry><term><parameter>replaces_external_ip</parameter> :</term> | |
327 | 314 | <listitem><simpara> if this mapping replaces another mapping, |
328 | 315 | this is the old external IP |
329 | 316 | </simpara></listitem></varlistentry> |
330 | <varlistentry><term><parameter>external_port</parameter> :</term> | |
317 | <varlistentry><term><parameter>external_port</parameter> :</term> | |
331 | 318 | <listitem><simpara> the external port that was allocated |
332 | 319 | </simpara></listitem></varlistentry> |
333 | <varlistentry><term><parameter>local_ip</parameter> :</term> | |
320 | <varlistentry><term><parameter>local_ip</parameter> :</term> | |
334 | 321 | <listitem><simpara> internal ip this is forwarded to |
335 | 322 | </simpara></listitem></varlistentry> |
336 | <varlistentry><term><parameter>local_port</parameter> :</term> | |
323 | <varlistentry><term><parameter>local_port</parameter> :</term> | |
337 | 324 | <listitem><simpara> the local port |
338 | 325 | </simpara></listitem></varlistentry> |
339 | <varlistentry><term><parameter>description</parameter> :</term> | |
326 | <varlistentry><term><parameter>description</parameter> :</term> | |
340 | 327 | <listitem><simpara> the user's selected description |
341 | 328 | </simpara></listitem></varlistentry> |
342 | <varlistentry><term><parameter>user_data</parameter> :</term> | |
329 | <varlistentry><term><parameter>user_data</parameter> :</term> | |
343 | 330 | <listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry> |
344 | 331 | </variablelist></refsect2> |
345 | 332 | </refsect1> |
6 | 6 | if GTK_DOC_USE_LIBTOOL |
7 | 7 | GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
8 | 8 | GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) |
9 | GTKDOC_RUN = $(LIBTOOL) --mode=execute | |
9 | 10 | else |
10 | 11 | GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
11 | 12 | GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) |
13 | GTKDOC_RUN = sh -c | |
12 | 14 | endif |
13 | 15 | |
14 | 16 | # We set GPATH here; this gives us semantics for GNU make |
52 | 54 | |
53 | 55 | docs: html-build.stamp |
54 | 56 | |
57 | $(REPORT_FILES): sgml-build.stamp | |
58 | ||
55 | 59 | #### scan #### |
56 | 60 | |
57 | 61 | scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) |
60 | 64 | cd $(srcdir) && \ |
61 | 65 | gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) |
62 | 66 | if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ |
63 | CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ | |
67 | 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) ; \ | |
64 | 68 | else \ |
65 | 69 | cd $(srcdir) ; \ |
66 | 70 | for i in $(SCANOBJ_FILES) ; do \ |
106 | 110 | @-chmod -R u+w $(srcdir) |
107 | 111 | rm -rf $(srcdir)/html |
108 | 112 | mkdir $(srcdir)/html |
109 | cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) | |
113 | mkhtml_options=""; \ | |
114 | gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ | |
115 | if test "$(?)" = "0"; then \ | |
116 | mkhtml_options=--path="$(srcdir)"; \ | |
117 | fi | |
118 | cd $(srcdir)/html && gtkdoc-mkhtml $(mkhtml_options) $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) | |
110 | 119 | test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) |
111 | 120 | @echo 'gtk-doc: Fixing cross-references' |
112 | 121 | cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) |
127 | 136 | cd $(srcdir) && rm -rf xml html |
128 | 137 | |
129 | 138 | install-data-local: |
130 | -installfiles=`echo $(srcdir)/html/*`; \ | |
139 | installfiles=`echo $(srcdir)/html/*`; \ | |
131 | 140 | if test "$$installfiles" = '$(srcdir)/html/*'; \ |
132 | 141 | then echo '-- Nothing to install' ; \ |
133 | 142 | else \ |
134 | $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ | |
143 | if test -n "$(DOC_MODULE_VERSION)"; then \ | |
144 | installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ | |
145 | else \ | |
146 | installdir="$(DESTDIR)$(TARGET_DIR)"; \ | |
147 | fi; \ | |
148 | $(mkinstalldirs) $${installdir} ; \ | |
135 | 149 | for i in $$installfiles; do \ |
136 | 150 | echo '-- Installing '$$i ; \ |
137 | $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ | |
151 | $(INSTALL_DATA) $$i $${installdir}; \ | |
138 | 152 | done; \ |
139 | echo '-- Installing $(srcdir)/html/index.sgml' ; \ | |
140 | $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ | |
141 | which gtkdoc-rebase >/dev/null && \ | |
142 | gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \ | |
153 | if test -n "$(DOC_MODULE_VERSION)"; then \ | |
154 | mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ | |
155 | $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ | |
156 | mv -f $${installdir}/$(DOC_MODULE).devhelp \ | |
157 | $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ | |
158 | fi; \ | |
159 | ! which gtkdoc-rebase >/dev/null 2>&1 || \ | |
160 | gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir} ; \ | |
143 | 161 | fi |
144 | ||
145 | 162 | |
146 | 163 | uninstall-local: |
147 | rm -f $(DESTDIR)$(TARGET_DIR)/* | |
164 | if test -n "$(DOC_MODULE_VERSION)"; then \ | |
165 | installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ | |
166 | else \ | |
167 | installdir="$(DESTDIR)$(TARGET_DIR)"; \ | |
168 | fi; \ | |
169 | rm -rf $${installdir} | |
148 | 170 | |
149 | 171 | # |
150 | 172 | # Require gtk-doc when making dist |
167 | 189 | -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ |
168 | 190 | -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ |
169 | 191 | cd $(distdir) && rm -f $(DISTCLEANFILES) |
170 | -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html | |
192 | ! which gtkdoc-rebase >/dev/null 2>&1 || \ | |
193 | gtkdoc-rebase --online --relative --html-dir=$(distdir)/html | |
171 | 194 | |
172 | 195 | .PHONY : dist-hook-local docs |
0 | 0 | prefix=@prefix@ |
1 | exec_prefix=${prefix} | |
2 | libdir=${exec_prefix}/lib | |
3 | includedir=${prefix}/include | |
1 | exec_prefix=@exec_prefix@ | |
2 | libdir=@libdir@ | |
3 | includedir=@includedir@ | |
4 | 4 | |
5 | 5 | Name: gupnp-igd-1.0 |
6 | 6 | Description: GUPnP Simple IGD library |
3 | 3 | # interfaces added -> increment AGE |
4 | 4 | # interfaces removed -> AGE = 0 |
5 | 5 | |
6 | LTVERSION = 2:0:0 | |
6 | LTVERSION = 2:1:0 | |
7 | 7 | |
8 | 8 | AM_CFLAGS = $(LIBGUPNP_CFLAGS) -I$(top_srcdir) |
9 | 9 |
202 | 202 | top_build_prefix = @top_build_prefix@ |
203 | 203 | top_builddir = @top_builddir@ |
204 | 204 | top_srcdir = @top_srcdir@ |
205 | LTVERSION = 2:0:0 | |
205 | LTVERSION = 2:1:0 | |
206 | 206 | AM_CFLAGS = $(LIBGUPNP_CFLAGS) -I$(top_srcdir) |
207 | 207 | libgupnp_igd_incdir = $(includedir)/gupnp-igd-1.0/libgupnp-igd |
208 | 208 | lib_LTLIBRARIES = libgupnp-igd-1.0.la |
31 | 31 | |
32 | 32 | #include "gupnp-simple-igd-thread.h" |
33 | 33 | |
34 | #ifndef G_GNUC_MAY_ALIAS | |
35 | # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) | |
36 | # define G_GNUC_MAY_ALIAS __attribute__((may_alias)) | |
37 | # else | |
38 | # define G_GNUC_MAY_ALIAS | |
39 | # endif | |
40 | #endif | |
34 | ||
35 | struct thread_data | |
36 | { | |
37 | gint refcount; | |
38 | ||
39 | GMutex *mutex; | |
40 | ||
41 | GMainContext *context; | |
42 | GMainLoop *loop; | |
43 | gboolean all_mappings_deleted; | |
44 | }; | |
41 | 45 | |
42 | 46 | struct _GUPnPSimpleIgdThreadPrivate |
43 | 47 | { |
44 | 48 | GThread *thread; |
45 | 49 | GMainContext *context; |
46 | GMutex *mutex; | |
47 | ||
48 | /* Protected by mutex */ | |
49 | gboolean quit_loop; | |
50 | GMainLoop *loop; | |
50 | ||
51 | /* Protected by mutex inside thread_data*/ | |
52 | gboolean can_dispose; | |
53 | GCond *can_dispose_cond; | |
54 | ||
55 | struct thread_data *thread_data; | |
51 | 56 | }; |
52 | 57 | |
53 | 58 | |
55 | 60 | (G_TYPE_INSTANCE_GET_PRIVATE ((o), GUPNP_TYPE_SIMPLE_IGD_THREAD, \ |
56 | 61 | GUPnPSimpleIgdThreadPrivate)) |
57 | 62 | |
58 | #define GUPNP_SIMPLE_IGD_THREAD_LOCK(o) g_mutex_lock ((o)->priv->mutex) | |
59 | #define GUPNP_SIMPLE_IGD_THREAD_UNLOCK(o) g_mutex_unlock ((o)->priv->mutex) | |
63 | #define GUPNP_SIMPLE_IGD_THREAD_LOCK(o) \ | |
64 | g_mutex_lock ((o)->priv->thread_data->mutex) | |
65 | #define GUPNP_SIMPLE_IGD_THREAD_UNLOCK(o) \ | |
66 | g_mutex_unlock ((o)->priv->thread_data->mutex) | |
60 | 67 | |
61 | 68 | |
62 | 69 | G_DEFINE_TYPE (GUPnPSimpleIgdThread, gupnp_simple_igd_thread, |
99 | 106 | { |
100 | 107 | self->priv = GUPNP_SIMPLE_IGD_THREAD_GET_PRIVATE (self); |
101 | 108 | |
102 | self->priv->mutex = g_mutex_new (); | |
103 | 109 | self->priv->context = g_main_context_new (); |
110 | self->priv->can_dispose_cond = g_cond_new (); | |
104 | 111 | |
105 | 112 | g_object_set (self, "main-context", self->priv->context, NULL); |
106 | 113 | } |
107 | 114 | |
108 | 115 | static gboolean |
109 | main_loop_quit (gpointer user_data) | |
110 | { | |
111 | GMainLoop *loop = user_data; | |
112 | ||
113 | g_main_loop_quit (loop); | |
116 | delete_all_mappings (gpointer user_data) | |
117 | { | |
118 | GUPnPSimpleIgdThread *self = user_data; | |
119 | gboolean can_dispose; | |
120 | ||
121 | can_dispose = gupnp_simple_igd_delete_all_mappings (GUPNP_SIMPLE_IGD (self)); | |
122 | ||
123 | GUPNP_SIMPLE_IGD_THREAD_LOCK (self); | |
124 | self->priv->can_dispose |= can_dispose; | |
125 | self->priv->thread_data->all_mappings_deleted = TRUE; | |
126 | GUPNP_SIMPLE_IGD_THREAD_UNLOCK (self); | |
127 | ||
128 | g_cond_broadcast (self->priv->can_dispose_cond); | |
129 | ||
114 | 130 | return FALSE; |
115 | 131 | } |
116 | 132 | |
117 | ||
118 | 133 | static void |
119 | 134 | gupnp_simple_igd_thread_dispose (GObject *object) |
120 | 135 | { |
121 | 136 | GUPnPSimpleIgdThread *self = GUPNP_SIMPLE_IGD_THREAD_CAST (object); |
122 | 137 | |
123 | 138 | GUPNP_SIMPLE_IGD_THREAD_LOCK (self); |
124 | if (self->priv->loop) | |
139 | if (g_thread_self () == self->priv->thread) | |
140 | { | |
141 | GUPNP_SIMPLE_IGD_THREAD_UNLOCK (self); | |
142 | ||
143 | if (!gupnp_simple_igd_delete_all_mappings (GUPNP_SIMPLE_IGD (self))) | |
144 | return; | |
145 | ||
146 | GUPNP_SIMPLE_IGD_THREAD_LOCK (self); | |
147 | if (self->priv->thread_data->loop) | |
148 | g_main_loop_quit (self->priv->thread_data->loop); | |
149 | GUPNP_SIMPLE_IGD_THREAD_UNLOCK (self); | |
150 | } | |
151 | else | |
125 | 152 | { |
126 | 153 | GSource *stop_src; |
127 | g_main_loop_ref (self->priv->loop); | |
128 | stop_src = g_idle_source_new (); | |
129 | g_source_set_priority (stop_src, G_PRIORITY_HIGH); | |
130 | g_source_set_callback (stop_src, main_loop_quit, self->priv->loop, | |
131 | (GDestroyNotify) g_main_loop_unref); | |
132 | g_source_attach (stop_src, self->priv->context); | |
133 | g_source_unref (stop_src); | |
134 | g_main_loop_quit (self->priv->loop); | |
154 | GSource *delete_all_src; | |
155 | ||
156 | delete_all_src = g_idle_source_new (); | |
157 | g_source_set_priority (delete_all_src, G_PRIORITY_HIGH); | |
158 | g_source_set_callback (delete_all_src, delete_all_mappings, | |
159 | g_object_ref (self), | |
160 | g_object_unref); | |
161 | g_source_attach (delete_all_src, self->priv->context); | |
162 | g_source_unref (delete_all_src); | |
163 | ||
164 | while (!self->priv->thread_data->all_mappings_deleted) | |
165 | g_cond_wait (self->priv->can_dispose_cond, | |
166 | self->priv->thread_data->mutex); | |
167 | ||
168 | if (!self->priv->can_dispose) | |
169 | { | |
170 | GUPNP_SIMPLE_IGD_THREAD_UNLOCK (self); | |
171 | return; | |
172 | } | |
173 | ||
174 | if (self->priv->thread_data->loop) | |
175 | { | |
176 | g_main_loop_quit (self->priv->thread_data->loop); | |
177 | } | |
178 | GUPNP_SIMPLE_IGD_THREAD_UNLOCK (self); | |
179 | ||
180 | g_thread_join (self->priv->thread); | |
181 | self->priv->thread = NULL; | |
135 | 182 | } |
136 | self->priv->quit_loop = TRUE; | |
137 | GUPNP_SIMPLE_IGD_THREAD_UNLOCK (self); | |
138 | ||
139 | g_thread_join (self->priv->thread); | |
140 | self->priv->thread = NULL; | |
141 | 183 | |
142 | 184 | G_OBJECT_CLASS (gupnp_simple_igd_thread_parent_class)->dispose (object); |
143 | 185 | } |
144 | 186 | |
145 | 187 | static void |
188 | thread_data_dec (struct thread_data *data) | |
189 | { | |
190 | if (g_atomic_int_dec_and_test (&data->refcount)) | |
191 | { | |
192 | g_mutex_free (data->mutex); | |
193 | g_main_context_unref (data->context); | |
194 | g_slice_free (struct thread_data, data); | |
195 | } | |
196 | } | |
197 | ||
198 | static void | |
146 | 199 | gupnp_simple_igd_thread_finalize (GObject *object) |
147 | 200 | { |
148 | 201 | GUPnPSimpleIgdThread *self = GUPNP_SIMPLE_IGD_THREAD_CAST (object); |
149 | 202 | |
150 | 203 | g_main_context_unref (self->priv->context); |
151 | g_mutex_free (self->priv->mutex); | |
204 | g_cond_free (self->priv->can_dispose_cond); | |
205 | ||
206 | thread_data_dec (self->priv->thread_data); | |
152 | 207 | |
153 | 208 | G_OBJECT_CLASS (gupnp_simple_igd_thread_parent_class)->finalize (object); |
154 | 209 | } |
155 | 210 | |
156 | 211 | static gpointer |
157 | thread_func (gpointer data) | |
158 | { | |
159 | GUPnPSimpleIgdThread *self = data; | |
160 | GMainLoop *loop = g_main_loop_new (self->priv->context, FALSE); | |
161 | gboolean quit_loop; | |
162 | ||
163 | GUPNP_SIMPLE_IGD_THREAD_LOCK (self); | |
164 | self->priv->loop = loop; | |
165 | quit_loop = self->priv->quit_loop; | |
166 | GUPNP_SIMPLE_IGD_THREAD_UNLOCK (self); | |
167 | ||
168 | if (!quit_loop) | |
169 | g_main_loop_run (loop); | |
170 | ||
171 | GUPNP_SIMPLE_IGD_THREAD_LOCK (self); | |
172 | self->priv->loop = NULL; | |
173 | GUPNP_SIMPLE_IGD_THREAD_UNLOCK (self); | |
212 | thread_func (gpointer dat) | |
213 | { | |
214 | struct thread_data *data = dat; | |
215 | GMainLoop *loop = g_main_loop_new (data->context, FALSE); | |
216 | ||
217 | g_mutex_lock (data->mutex); | |
218 | data->loop = loop; | |
219 | g_mutex_unlock (data->mutex); | |
220 | ||
221 | g_main_loop_run (loop); | |
222 | ||
223 | g_mutex_lock (data->mutex); | |
224 | data->loop = NULL; | |
225 | data->all_mappings_deleted = TRUE; | |
226 | g_mutex_unlock (data->mutex); | |
174 | 227 | |
175 | 228 | g_main_loop_unref (loop); |
176 | 229 | |
230 | thread_data_dec (data); | |
231 | ||
177 | 232 | return NULL; |
178 | 233 | } |
179 | 234 | |
181 | 236 | gupnp_simple_igd_thread_constructed (GObject *object) |
182 | 237 | { |
183 | 238 | GUPnPSimpleIgdThread *self = GUPNP_SIMPLE_IGD_THREAD_CAST (object); |
239 | struct thread_data *data = g_slice_new0 (struct thread_data); | |
184 | 240 | |
185 | 241 | if (G_OBJECT_CLASS (gupnp_simple_igd_thread_parent_class)->constructed) |
186 | 242 | G_OBJECT_CLASS (gupnp_simple_igd_thread_parent_class)->constructed (object); |
187 | 243 | |
188 | self->priv->thread = g_thread_create (thread_func, self, TRUE, NULL); | |
244 | g_atomic_int_set (&data->refcount, 2); | |
245 | ||
246 | self->priv->thread_data = data; | |
247 | ||
248 | data->mutex = g_mutex_new (); | |
249 | g_main_context_ref (self->priv->context); | |
250 | data->context = self->priv->context; | |
251 | ||
252 | self->priv->thread = g_thread_create (thread_func, data, TRUE, NULL); | |
189 | 253 | g_return_if_fail (self->priv->thread); |
190 | 254 | } |
191 | 255 |
56 | 56 | |
57 | 57 | gulong ppp_avail_handler; |
58 | 58 | gulong ppp_unavail_handler; |
59 | ||
60 | guint deleting_count; | |
59 | 61 | }; |
60 | 62 | |
61 | 63 | struct Proxy { |
133 | 135 | struct Mapping *mapping); |
134 | 136 | |
135 | 137 | static void free_proxy (struct Proxy *prox); |
136 | static void free_mapping (struct Mapping *mapping); | |
137 | ||
138 | static void stop_proxymapping (struct ProxyMapping *pm); | |
138 | static void free_mapping (GUPnPSimpleIgd *self, struct Mapping *mapping); | |
139 | ||
140 | static void stop_proxymapping (struct ProxyMapping *pm, gboolean stop_renew); | |
139 | 141 | |
140 | 142 | static void gupnp_simple_igd_add_port_real (GUPnPSimpleIgd *self, |
141 | 143 | const gchar *protocol, |
246 | 248 | self->priv->mappings = g_ptr_array_new (); |
247 | 249 | } |
248 | 250 | |
249 | static void | |
250 | gupnp_simple_igd_dispose (GObject *object) | |
251 | { | |
252 | GUPnPSimpleIgd *self = GUPNP_SIMPLE_IGD_CAST (object); | |
253 | ||
251 | /** | |
252 | * gupnp_simple_igd_delete_all_mappings: | |
253 | * @self: a #GUPnPSimpleIgd | |
254 | * | |
255 | * Removes all mappings and prevents other from being formed | |
256 | * Should only be called by the dispose function of subclasses | |
257 | * | |
258 | * Returns: %TRUE if the object can be disposed, %FALSE otherwise | |
259 | */ | |
260 | ||
261 | gboolean | |
262 | gupnp_simple_igd_delete_all_mappings (GUPnPSimpleIgd *self) | |
263 | { | |
254 | 264 | if (self->priv->ip_avail_handler) |
255 | 265 | g_signal_handler_disconnect (self->priv->ip_cp, |
256 | 266 | self->priv->ip_avail_handler); |
273 | 283 | |
274 | 284 | while (self->priv->mappings->len) |
275 | 285 | { |
276 | free_mapping ( | |
277 | g_ptr_array_index (self->priv->mappings, 0)); | |
286 | free_mapping (self, g_ptr_array_index (self->priv->mappings, 0)); | |
278 | 287 | g_ptr_array_remove_index_fast (self->priv->mappings, 0); |
279 | 288 | } |
280 | 289 | |
290 | return (self->priv->deleting_count == 0); | |
291 | } | |
292 | ||
293 | static void | |
294 | gupnp_simple_igd_dispose (GObject *object) | |
295 | { | |
296 | GUPnPSimpleIgd *self = GUPNP_SIMPLE_IGD_CAST (object); | |
297 | ||
298 | if (!gupnp_simple_igd_delete_all_mappings (self)) | |
299 | return; | |
300 | ||
281 | 301 | while (self->priv->service_proxies->len) |
282 | 302 | { |
283 | free_proxy ( | |
284 | g_ptr_array_index (self->priv->service_proxies, 0)); | |
303 | free_proxy (g_ptr_array_index (self->priv->service_proxies, 0)); | |
285 | 304 | g_ptr_array_remove_index_fast (self->priv->service_proxies, 0); |
286 | 305 | } |
287 | 306 | |
334 | 353 | } |
335 | 354 | |
336 | 355 | static void |
337 | free_proxymapping (struct ProxyMapping *pm) | |
338 | { | |
356 | _service_proxy_delete_port_mapping (GUPnPServiceProxy *proxy, | |
357 | GUPnPServiceProxyAction *action, | |
358 | gpointer user_data) | |
359 | { | |
360 | GError *error = NULL; | |
361 | GUPnPSimpleIgd *self = user_data; | |
362 | ||
363 | ||
364 | if (!gupnp_service_proxy_end_action (proxy, action, &error, | |
365 | NULL)) | |
366 | { | |
367 | g_return_if_fail (error); | |
368 | g_warning ("Error deleting port mapping: %s", error->message); | |
369 | } | |
370 | g_clear_error (&error); | |
371 | ||
372 | if (self) | |
373 | { | |
374 | self->priv->deleting_count--; | |
375 | g_object_unref (self); | |
376 | } | |
377 | } | |
378 | ||
379 | static void | |
380 | free_proxymapping (struct ProxyMapping *pm, GUPnPSimpleIgd *self) | |
381 | { | |
382 | stop_proxymapping (pm, TRUE); | |
383 | ||
384 | if (pm->mapped && self) | |
385 | { | |
386 | self->priv->deleting_count++; | |
387 | g_object_ref (self); | |
388 | gupnp_service_proxy_begin_action (pm->proxy->proxy, | |
389 | "DeletePortMapping", | |
390 | _service_proxy_delete_port_mapping, self, | |
391 | "NewRemoteHost", G_TYPE_STRING, "", | |
392 | "NewExternalPort", G_TYPE_UINT, pm->actual_external_port, | |
393 | "NewProtocol", G_TYPE_STRING, pm->mapping->protocol, | |
394 | NULL); | |
395 | } | |
396 | ||
339 | 397 | g_slice_free (struct ProxyMapping, pm); |
340 | 398 | } |
341 | 399 | |
348 | 406 | gupnp_service_proxy_remove_notify (prox->proxy, "ExternalIPAddress", |
349 | 407 | _external_ip_address_changed, prox); |
350 | 408 | |
351 | g_object_unref (prox->proxy); | |
352 | g_ptr_array_foreach (prox->proxymappings, (GFunc) stop_proxymapping, NULL); | |
353 | 409 | g_ptr_array_foreach (prox->proxymappings, (GFunc) free_proxymapping, NULL); |
354 | 410 | g_ptr_array_free (prox->proxymappings, TRUE); |
411 | g_object_unref (prox->proxy); | |
355 | 412 | g_free (prox->external_ip); |
356 | 413 | g_slice_free (struct Proxy, prox); |
357 | 414 | } |
358 | 415 | |
359 | 416 | static void |
360 | free_mapping (struct Mapping *mapping) | |
361 | { | |
417 | free_mapping (GUPnPSimpleIgd *self, struct Mapping *mapping) | |
418 | { | |
419 | guint i, j; | |
420 | ||
421 | for (i=0; i < self->priv->service_proxies->len; i++) | |
422 | { | |
423 | struct Proxy *prox = g_ptr_array_index (self->priv->service_proxies, i); | |
424 | ||
425 | for (j=0; j < prox->proxymappings->len; j++) | |
426 | { | |
427 | struct ProxyMapping *pm = g_ptr_array_index (prox->proxymappings, j); | |
428 | if (pm->mapping == mapping) | |
429 | { | |
430 | free_proxymapping (pm, self); | |
431 | g_ptr_array_remove_index_fast (prox->proxymappings, j); | |
432 | j--; | |
433 | } | |
434 | } | |
435 | } | |
436 | ||
362 | 437 | g_free (mapping->protocol); |
363 | 438 | g_free (mapping->local_ip); |
364 | 439 | g_free (mapping->description); |
469 | 544 | if (!strcmp (gupnp_service_info_get_udn (GUPNP_SERVICE_INFO (prox->proxy)), |
470 | 545 | gupnp_service_info_get_udn (GUPNP_SERVICE_INFO (prox->proxy)))) |
471 | 546 | { |
472 | g_ptr_array_foreach (prox->proxymappings, (GFunc) stop_proxymapping, | |
473 | NULL); | |
474 | g_ptr_array_foreach (prox->proxymappings, (GFunc) free_proxymapping, | |
475 | NULL); | |
476 | 547 | free_proxy (prox); |
477 | 548 | g_ptr_array_remove_index_fast (self->priv->service_proxies, i); |
478 | 549 | break; |
652 | 723 | gupnp_simple_igd_call_add_port_mapping (struct ProxyMapping *pm, |
653 | 724 | GUPnPServiceProxyActionCallback callback) |
654 | 725 | { |
726 | g_assert (pm); | |
655 | 727 | g_return_if_fail (pm->action == NULL); |
728 | g_assert (pm->proxy); | |
729 | g_assert (pm->mapping); | |
656 | 730 | |
657 | 731 | pm->action = gupnp_service_proxy_begin_action (pm->proxy->proxy, |
658 | 732 | "AddPortMapping", |
673 | 747 | { |
674 | 748 | struct ProxyMapping *pm = user_data; |
675 | 749 | |
676 | stop_proxymapping (pm); | |
750 | stop_proxymapping (pm, FALSE); | |
677 | 751 | |
678 | 752 | gupnp_simple_igd_call_add_port_mapping (pm, |
679 | 753 | _service_proxy_renewed_port_mapping); |
707 | 781 | |
708 | 782 | |
709 | 783 | |
710 | pm->renew_src = | |
711 | g_timeout_source_new_seconds (pm->mapping->lease_duration / 2); | |
712 | g_source_set_callback (pm->renew_src, | |
713 | _renew_mapping_timeout, pm, NULL); | |
714 | g_source_attach (pm->renew_src, self->priv->main_context); | |
715 | ||
784 | if (pm->mapping->lease_duration > 0) | |
785 | { | |
786 | pm->renew_src = | |
787 | g_timeout_source_new_seconds (pm->mapping->lease_duration / 2); | |
788 | g_source_set_callback (pm->renew_src, | |
789 | _renew_mapping_timeout, pm, NULL); | |
790 | g_source_attach (pm->renew_src, self->priv->main_context); | |
791 | } | |
716 | 792 | } |
717 | 793 | else |
718 | 794 | { |
847 | 923 | lease_duration, description); |
848 | 924 | } |
849 | 925 | |
850 | ||
851 | static void | |
852 | _service_proxy_delete_port_mapping (GUPnPServiceProxy *proxy, | |
853 | GUPnPServiceProxyAction *action, | |
854 | gpointer user_data) | |
855 | { | |
856 | GError *error = NULL; | |
857 | ||
858 | ||
859 | if (!gupnp_service_proxy_end_action (proxy, action, &error, | |
860 | NULL)) | |
861 | { | |
862 | g_return_if_fail (error); | |
863 | g_warning ("Error deleting port mapping: %s", error->message); | |
864 | } | |
865 | g_clear_error (&error); | |
866 | } | |
867 | ||
868 | 926 | static void |
869 | 927 | gupnp_simple_igd_remove_port_real (GUPnPSimpleIgd *self, |
870 | 928 | const gchar *protocol, |
871 | 929 | guint external_port) |
872 | 930 | { |
873 | guint i, j; | |
874 | 931 | struct Mapping *mapping = NULL; |
932 | guint i; | |
875 | 933 | |
876 | 934 | g_return_if_fail (protocol); |
877 | 935 | |
890 | 948 | |
891 | 949 | g_ptr_array_remove_index_fast (self->priv->mappings, i); |
892 | 950 | |
893 | for (i=0; i < self->priv->service_proxies->len; i++) | |
894 | { | |
895 | struct Proxy *prox = g_ptr_array_index (self->priv->service_proxies, i); | |
896 | ||
897 | for (j=0; j < prox->proxymappings->len; j++) | |
898 | { | |
899 | struct ProxyMapping *pm = g_ptr_array_index (prox->proxymappings, j); | |
900 | if (pm->mapping == mapping) | |
901 | { | |
902 | stop_proxymapping (pm); | |
903 | ||
904 | if (pm->renew_src) | |
905 | { | |
906 | g_source_destroy (pm->renew_src); | |
907 | g_source_unref (pm->renew_src); | |
908 | } | |
909 | pm->renew_src = NULL; | |
910 | ||
911 | if (pm->mapped) | |
912 | gupnp_service_proxy_begin_action (prox->proxy, | |
913 | "DeletePortMapping", | |
914 | _service_proxy_delete_port_mapping, self, | |
915 | "NewRemoteHost", G_TYPE_STRING, "", | |
916 | "NewExternalPort", G_TYPE_UINT, pm->actual_external_port, | |
917 | "NewProtocol", G_TYPE_STRING, mapping->protocol, | |
918 | NULL); | |
919 | ||
920 | free_proxymapping (pm); | |
921 | g_ptr_array_remove_index_fast (prox->proxymappings, j); | |
922 | j--; | |
923 | } | |
924 | } | |
925 | } | |
926 | ||
927 | free_mapping (mapping); | |
951 | free_mapping (self, mapping); | |
928 | 952 | } |
929 | 953 | |
930 | 954 | /** |
953 | 977 | } |
954 | 978 | |
955 | 979 | static void |
956 | stop_proxymapping (struct ProxyMapping *pm) | |
980 | stop_proxymapping (struct ProxyMapping *pm, gboolean stop_renew) | |
957 | 981 | { |
958 | 982 | if (pm->action) |
959 | 983 | gupnp_service_proxy_cancel_action (pm->proxy->proxy, |
960 | 984 | pm->action); |
961 | 985 | pm->action = NULL; |
962 | } | |
986 | ||
987 | if (stop_renew && pm->renew_src) | |
988 | { | |
989 | g_source_destroy (pm->renew_src); | |
990 | g_source_unref (pm->renew_src); | |
991 | pm->renew_src = NULL; | |
992 | } | |
993 | } |
133 | 133 | const gchar *protocol, |
134 | 134 | guint external_port); |
135 | 135 | |
136 | ||
137 | gboolean | |
138 | gupnp_simple_igd_delete_all_mappings (GUPnPSimpleIgd *self); | |
139 | ||
140 | ||
136 | 141 | G_END_DECLS |
137 | 142 | |
138 | 143 | #endif /* __GUPNP_SIMPLE_IGD_H__ */ |
47 | 47 | static GUPnPServiceInfo *ipservice = NULL; |
48 | 48 | static GUPnPServiceInfo *pppservice = NULL; |
49 | 49 | |
50 | gboolean return_conflict = 0; | |
50 | gboolean return_conflict = FALSE; | |
51 | gboolean dispose_removes = FALSE; | |
51 | 52 | |
52 | 53 | |
53 | 54 | static void |
191 | 192 | !strcmp (external_ip, IP_ADDRESS_SECOND)) || |
192 | 193 | (!strcmp (replaces_external_ip, PPP_ADDRESS_FIRST) && |
193 | 194 | !strcmp (external_ip, PPP_ADDRESS_SECOND))); |
194 | gupnp_simple_igd_remove_port (igd, "UDP", requested_external_port); | |
195 | if (dispose_removes) | |
196 | g_object_unref (igd); | |
197 | else | |
198 | gupnp_simple_igd_remove_port (igd, "UDP", requested_external_port); | |
195 | 199 | } |
196 | 200 | else |
197 | 201 | { |
285 | 289 | INTERNAL_PORT, 10, "GUPnP Simple IGD test"); |
286 | 290 | |
287 | 291 | loop = g_main_loop_new (mainctx, FALSE); |
288 | ||
289 | 292 | g_main_loop_run (loop); |
293 | g_main_loop_unref (loop); | |
290 | 294 | |
291 | 295 | g_object_unref (context); |
296 | ||
292 | 297 | } |
293 | 298 | |
294 | 299 | static void |
344 | 349 | return_conflict = FALSE; |
345 | 350 | g_object_unref (igd); |
346 | 351 | } |
352 | ||
353 | ||
354 | static void | |
355 | test_gupnp_simple_igd_dispose_removes (void) | |
356 | { | |
357 | GUPnPSimpleIgd *igd = gupnp_simple_igd_new (NULL); | |
358 | ||
359 | dispose_removes = TRUE; | |
360 | run_gupnp_simple_igd_test (NULL, igd, INTERNAL_PORT); | |
361 | dispose_removes = FALSE; | |
362 | } | |
363 | ||
364 | ||
365 | static void | |
366 | test_gupnp_simple_igd_dispose_removes_thread (void) | |
367 | { | |
368 | GUPnPSimpleIgdThread *igd = gupnp_simple_igd_thread_new (); | |
369 | GMainContext *mainctx = g_main_context_new (); | |
370 | ||
371 | dispose_removes = TRUE; | |
372 | run_gupnp_simple_igd_test (mainctx, GUPNP_SIMPLE_IGD (igd), INTERNAL_PORT); | |
373 | dispose_removes = FALSE; | |
374 | g_main_context_unref (mainctx); | |
375 | } | |
376 | ||
347 | 377 | |
348 | 378 | |
349 | 379 | int main (int argc, char **argv) |
360 | 390 | test_gupnp_simple_igd_random_no_conflict); |
361 | 391 | g_test_add_func ("/simpleigd/random/conflict", |
362 | 392 | test_gupnp_simple_igd_random_conflict); |
393 | g_test_add_func ("/simpleigd/dispose_removes/regular", | |
394 | test_gupnp_simple_igd_dispose_removes); | |
395 | g_test_add_func ("/simpleigd/dispose_removes/thread", | |
396 | test_gupnp_simple_igd_dispose_removes_thread); | |
363 | 397 | |
364 | 398 | g_test_run (); |
365 | 399 |