Codebase list gupnp-igd / 4bb50b7
Imported Upstream version 0.1.3 Laurent Bigonville 14 years ago
25 changed file(s) with 558 addition(s) and 361 deletion(s). Raw diff Collapse all Expand all
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
07
18 *******************
29 * GUPnP IGD 0.1.2 *
00 #! /bin/sh
11 # 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.
33 #
44 # Report bugs to <http://www.gupnp.org/>.
55 #
749749 # Identity of this package.
750750 PACKAGE_NAME='gupnp-igd'
751751 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'
754754 PACKAGE_BUGREPORT='http://www.gupnp.org/'
755755
756756 ac_unique_file="libgupnp-igd/gupnp-simple-igd.h"
14971497 # Omit some internal or obsolete options to make the list less imposing.
14981498 # This message is too long to be a string in the A/UX 3.1 sh.
14991499 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.
15011501
15021502 Usage: $0 [OPTION]... [VAR=VALUE]...
15031503
15671567
15681568 if test -n "$ac_init_help"; then
15691569 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:";;
15711571 esac
15721572 cat <<\_ACEOF
15731573
16821682 test -n "$ac_init_help" && exit $ac_status
16831683 if $ac_init_version; then
16841684 cat <<\_ACEOF
1685 gupnp-igd configure 0.1.2
1685 gupnp-igd configure 0.1.3
16861686 generated by GNU Autoconf 2.63
16871687
16881688 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
16961696 This file contains any messages produced by compilers while
16971697 running configure, to aid debugging if configure makes a mistake.
16981698
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
17001700 generated by GNU Autoconf 2.63. Invocation command line was
17011701
17021702 $ $0 $@
24122412
24132413 # Define the identity of the package.
24142414 PACKAGE='gupnp-igd'
2415 VERSION='0.1.2'
2415 VERSION='0.1.3'
24162416
24172417
24182418 cat >>confdefs.h <<_ACEOF
2222922229 # report actual input values of CONFIG_FILES etc. instead of their
2223022230 # values after options handling.
2223122231 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
2223322233 generated by GNU Autoconf 2.63. Invocation command line was
2223422234
2223522235 CONFIG_FILES = $CONFIG_FILES
2229222292 _ACEOF
2229322293 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2229422294 ac_cs_version="\\
22295 gupnp-igd config.status 0.1.2
22295 gupnp-igd config.status 0.1.3
2229622296 configured by $0, generated by GNU Autoconf 2.63,
2229722297 with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
2229822298
00 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/)
22 AM_INIT_AUTOMAKE()
33 AC_CONFIG_SRCDIR(libgupnp-igd/gupnp-simple-igd.h)
44 AM_CONFIG_HEADER(config.h)
243243 @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
244244 @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
245245 @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
246248
247249 # We set GPATH here; this gives us semantics for GNU make
248250 # which are more like other make's VPATH, when it comes to
457459
458460 docs: html-build.stamp
459461
462 $(REPORT_FILES): sgml-build.stamp
463
460464 #### scan ####
461465
462466 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
465469 cd $(srcdir) && \
466470 gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
467471 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) ; \
469473 else \
470474 cd $(srcdir) ; \
471475 for i in $(SCANOBJ_FILES) ; do \
510514 @-chmod -R u+w $(srcdir)
511515 rm -rf $(srcdir)/html
512516 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)
514523 test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
515524 @echo 'gtk-doc: Fixing cross-references'
516525 cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
531540 cd $(srcdir) && rm -rf xml html
532541
533542 install-data-local:
534 -installfiles=`echo $(srcdir)/html/*`; \
543 installfiles=`echo $(srcdir)/html/*`; \
535544 if test "$$installfiles" = '$(srcdir)/html/*'; \
536545 then echo '-- Nothing to install' ; \
537546 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} ; \
539553 for i in $$installfiles; do \
540554 echo '-- Installing '$$i ; \
541 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
555 $(INSTALL_DATA) $$i $${installdir}; \
542556 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} ; \
547565 fi
548566
549567 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}
551574
552575 #
553576 # Require gtk-doc when making dist
567590 -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
568591 -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
569592 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
571595
572596 .PHONY : dist-hook-local docs
573597
77 <link rel="up" href="ch01.html" title="Simple IGD module">
88 <link rel="prev" href="ch01.html" title="Simple IGD module">
99 <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)">
1111 <link rel="stylesheet" href="style.css" type="text/css">
1212 <link rel="chapter" href="ch01.html" title="Simple IGD module">
1313 </head>
2020 <th width="100%" align="center">GUPnP IGD Reference Manual</th>
2121 <td><a accesskey="n" href="GUPnPSimpleIgdThread.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
2222 </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>
3234 </table>
3335 <div class="refentry" lang="en">
3436 <a name="GUPnPSimpleIgd"></a><div class="titlepage"></div>
4446 <pre class="synopsis">
4547 <a class="link" href="GUPnPSimpleIgd.html#GUPnPSimpleIgd-struct" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a>;
4648 <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>
4850 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"
5153 >GMainContext</a> *main_context);
5254 <a
5355 href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void"
5456 >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,
5557 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"
5759 >gchar</a> *protocol,
5860 <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"
6062 >guint16</a> external_port,
6163 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"
6365 >gchar</a> *local_ip,
6466 <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"
6668 >guint16</a> local_port,
6769 <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"
6971 >guint32</a> lease_duration,
7072 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"
7274 >gchar</a> *description);
7375 <a
7476 href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void"
7577 >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,
7678 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"
7880 >gchar</a> *protocol,
7981 <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"
8183 >guint</a> external_port);
8284 </pre>
8385 </div>
8587 <a name="GUPnPSimpleIgd.object-hierarchy"></a><h2>Object Hierarchy</h2>
8688 <pre class="synopsis">
8789 <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"
8991 >GObject</a>
9092 +----GUPnPSimpleIgd
9193 +----<a class="link" href="GUPnPSimpleIgdThread.html" title="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</a>
9597 <a name="GUPnPSimpleIgd.properties"></a><h2>Properties</h2>
9698 <pre class="synopsis">
9799 "<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"
99101 >gpointer</a> : Read / Write / Construct Only
100102 "<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"
102104 >guint</a> : Read / Write
103105 </pre>
104106 </div>
117119 It also allows implementations to know the external port from the router's
118120 perspective.</p>
119121 <p>
120
121122 </p>
122123 </div>
123124 <div class="refsect1" lang="en">
128129 <p>
129130 All members are private, access them using methods and properties</p>
130131 <p>
131
132132 </p>
133133 </div>
134134 <hr>
155155 <p>
156156 The Raw UDP component transmitter class</p>
157157 <p>
158
159158 </p>
160159 <div class="variablelist"><table border="0">
161160 <col align="left" valign="top">
162161 <tbody>
163162 <tr>
164163 <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"
166165 >GObjectClass</a> <em class="structfield"><code>parent_class</code></em>;</span></p></td>
167166 <td> Our parent
168167 </td>
182181 </div>
183182 <hr>
184183 <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>
186185 <pre class="programlisting">#define GUPNP_SIMPLE_IGD_ERROR (gupnp_simple_igd_get_error_domain ())
187186 </pre>
188187 <p>
189188 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"
191190 ><span class="type">GError</span></a> domain for error coming out of GUPnpSimpleIGD</p>
192191 <p>
193
194192 </p>
195193 </div>
196194 <hr>
203201 <p>
204202 Errors coming out of the GUPnPSimpleIGD object.</p>
205203 <p>
206
207204 </p>
208205 <div class="variablelist"><table border="0">
209206 <col align="left" valign="top">
210207 <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>
212209 <td> Error getting the external
213210 address of the router
214211 </td>
218215 <hr>
219216 <div class="refsect2" lang="en">
220217 <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"
223220 >GMainContext</a> *main_context);</pre>
224221 <p>
225222 This creates a new <span class="type">GUPnpSimpleIgd</span> object using the special GMainContext</p>
226223 <p>
227
228224 </p>
229225 <div class="variablelist"><table border="0">
230226 <col align="left" valign="top">
232228 <tr>
233229 <td><p><span class="term"><em class="parameter"><code>main_context</code></em> :</span></p></td>
234230 <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"
236232 ><span class="type">GMainContext</span></a> to use (may be NULL for the default
237233 main context)
238234 </td>
252248 href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void"
253249 >void</a> gupnp_simple_igd_add_port (<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> *self,
254250 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"
256252 >gchar</a> *protocol,
257253 <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"
259255 >guint16</a> external_port,
260256 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"
262258 >gchar</a> *local_ip,
263259 <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"
265261 >guint16</a> local_port,
266262 <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"
268264 >guint32</a> lease_duration,
269265 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"
271267 >gchar</a> *description);</pre>
272268 <p>
273269 This adds a port to the router's forwarding table. The mapping will
280276 <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
281277 be emitted multiple times if there are multiple routers present.</p>
282278 <p>
283
284279 </p>
285280 <div class="variablelist"><table border="0">
286281 <col align="left" valign="top">
332327 href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void"
333328 >void</a> gupnp_simple_igd_remove_port (<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> *self,
334329 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"
336331 >gchar</a> *protocol,
337332 <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"
339334 >guint</a> external_port);</pre>
340335 <p>
341336 This tries to remove a port entry from the routers that was previously added
343338 it is a best effort mechanism. If it fails, the bindings will disapears after
344339 the lease duration set when the port where added.</p>
345340 <p>
346
347341 </p>
348342 <div class="variablelist"><table border="0">
349343 <col align="left" valign="top">
374368 <div class="refsect2" lang="en">
375369 <a name="GUPnPSimpleIgd--main-context"></a><h3>The <code class="literal">"main-context"</code> property</h3>
376370 <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"
378372 >gpointer</a> : Read / Write / Construct Only</pre>
379373 <p>This GMainContext will be used for all async activities.</p>
380374 </div>
382376 <div class="refsect2" lang="en">
383377 <a name="GUPnPSimpleIgd--request-timeout"></a><h3>The <code class="literal">"request-timeout"</code> property</h3>
384378 <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"
386380 >guint</a> : Read / Write</pre>
387381 <p>After this timeout, the request is considered to have failed andis dropped (in seconds).</p>
388382 <p>Default value: 5</p>
396390 href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void"
397391 >void</a> user_function (<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> *self,
398392 <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"
400394 >gpointer</a> error,
401395 <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"
403397 >gchar</a> *proto,
404398 <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"
406400 >guint</a> external_port,
407401 <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"
409403 >gchar</a> *local_ip,
410404 <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"
412406 >guint</a> local_port,
413407 <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"
415409 >gchar</a> *description,
416410 <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"
418412 >gpointer</a> user_data) : Run Last / Has Details</pre>
419413 <p>
420414 This means that mapping a port on a specific IGD has failed (it may still
421415 succeed on other IGDs on the network).</p>
422416 <p>
423
424417 </p>
425418 <div class="variablelist"><table border="0">
426419 <col align="left" valign="top">
433426 <tr>
434427 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
435428 <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"
437430 ><span class="type">GError</span></a>
438431 </td>
439432 </tr>
476469 href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#void"
477470 >void</a> user_function (<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a> *self,
478471 <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"
480473 >gchar</a> *proto,
481474 <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"
483476 >gchar</a> *external_ip,
484477 <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"
486479 >gchar</a> *replaces_external_ip,
487480 <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"
489482 >guint</a> external_port,
490483 <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"
492485 >gchar</a> *local_ip,
493486 <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"
495488 >guint</a> local_port,
496489 <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"
498491 >gchar</a> *description,
499492 <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"
501494 >gpointer</a> user_data) : Run Last</pre>
502495 <p>
503496 This signal means that an IGD has been found that that adding a port
504497 mapping has succeeded.</p>
505498 <p>
506
507499 </p>
508500 <div class="variablelist"><table border="0">
509501 <col align="left" valign="top">
560552 </div>
561553 <div class="footer">
562554 <hr>
563 Generated by GTK-Doc V1.10</div>
555 Generated by GTK-Doc V1.11</div>
564556 </body>
565557 </html>
66 <link rel="start" href="index.html" title="GUPnP IGD Reference Manual">
77 <link rel="up" href="ch01.html" title="Simple IGD module">
88 <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)">
1010 <link rel="stylesheet" href="style.css" type="text/css">
1111 <link rel="chapter" href="ch01.html" title="Simple IGD module">
1212 </head>
1919 <th width="100%" align="center">GUPnP IGD Reference Manual</th>
2020 <td> </td>
2121 </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>
2729 </table>
2830 <div class="refentry" lang="en">
2931 <a name="GUPnPSimpleIgdThread"></a><div class="titlepage"></div>
3941 <pre class="synopsis">
4042 <a class="link" href="GUPnPSimpleIgdThread.html#GUPnPSimpleIgdThread-struct" title="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</a>;
4143 <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);
4345 </pre>
4446 </div>
4547 <div class="refsect1" lang="en">
4648 <a name="GUPnPSimpleIgdThread.object-hierarchy"></a><h2>Object Hierarchy</h2>
4749 <pre class="synopsis">
4850 <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"
5052 >GObject</a>
5153 +----<a class="link" href="GUPnPSimpleIgd.html" title="GUPnPSimpleIgd">GUPnPSimpleIgd</a>
5254 +----GUPnPSimpleIgdThread
5759 <p>
5860 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
5961 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"
6163 ><span class="type">GMainLoop</span></a> running.</p>
6264 <p>
63
6465 </p>
6566 </div>
6667 <div class="refsect1" lang="en">
7172 <p>
7273 All members are private, access them using methods and properties</p>
7374 <p>
74
7575 </p>
7676 </div>
7777 <hr>
8686 <p>
8787 The Raw UDP component transmitter class</p>
8888 <p>
89
9089 </p>
9190 <div class="variablelist"><table border="0">
9291 <col align="left" valign="top">
10099 <hr>
101100 <div class="refsect2" lang="en">
102101 <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>
104103 <p>
105104 Creates a new <a class="link" href="GUPnPSimpleIgdThread.html" title="GUPnPSimpleIgdThread"><span class="type">GUPnPSimpleIgdThread</span></a></p>
106105 <p>
107
108106 </p>
109107 <div class="variablelist"><table border="0">
110108 <col align="left" valign="top">
119117 </div>
120118 <div class="footer">
121119 <hr>
122 Generated by GTK-Doc V1.10</div>
120 Generated by GTK-Doc V1.11</div>
123121 </body>
124122 </html>
77 <link rel="up" href="index.html" title="GUPnP IGD Reference Manual">
88 <link rel="prev" href="index.html" title="GUPnP IGD Reference Manual">
99 <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)">
1111 <link rel="stylesheet" href="style.css" type="text/css">
1212 <link rel="chapter" href="ch01.html" title="Simple IGD module">
1313 </head>
2121 </tr></table>
2222 <div class="chapter" lang="en">
2323 <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>
2525 <div class="toc"><dl>
2626 <dt>
2727 <span class="refentrytitle"><a href="GUPnPSimpleIgd.html">GUPnPSimpleIgd</a></span><span class="refpurpose"> — A simple class to map ports on UPnP routers</span>
3333 </div>
3434 <div class="footer">
3535 <hr>
36 Generated by GTK-Doc V1.10</div>
36 Generated by GTK-Doc V1.11</div>
3737 </body>
3838 </html>
99 <functions>
1010 <function name="GUPnPSimpleIgd" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-struct"/>
1111 <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"/>
1313 <function name="enum GUPnPSimpleIgdError" link="GUPnPSimpleIgd.html#GUPnPSimpleIgdError"/>
1414 <function name="gupnp_simple_igd_new ()" link="GUPnPSimpleIgd.html#gupnp-simple-igd-new"/>
1515 <function name="gupnp_simple_igd_add_port ()" link="GUPnPSimpleIgd.html#gupnp-simple-igd-add-port"/>
00 <?xml version="1.0" encoding="utf-8" standalone="no"?>
11 <!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">
33 <chapters>
44 <sub name="Simple IGD module" link="ch01.html">
55 <sub name="GUPnPSimpleIgd" link="GUPnPSimpleIgd.html"/>
99 <functions>
1010 <keyword type="struct" name="GUPnPSimpleIgd" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-struct"/>
1111 <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"/>
1313 <keyword type="enum" name="enum GUPnPSimpleIgdError" link="GUPnPSimpleIgd.html#GUPnPSimpleIgdError"/>
1414 <keyword type="function" name="gupnp_simple_igd_new ()" link="GUPnPSimpleIgd.html#gupnp-simple-igd-new"/>
1515 <keyword type="function" name="gupnp_simple_igd_add_port ()" link="GUPnPSimpleIgd.html#gupnp-simple-igd-add-port"/>
1616 <keyword type="function" name="gupnp_simple_igd_remove_port ()" link="GUPnPSimpleIgd.html#gupnp-simple-igd-remove-port"/>
17 <keyword type="" name="The &quot;main-context&quot; property" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd--main-context"/>
18 <keyword type="" name="The &quot;request-timeout&quot; property" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd--request-timeout"/>
19 <keyword type="" name="The &quot;error-mapping-port&quot; signal" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-error-mapping-port"/>
20 <keyword type="" name="The &quot;mapped-external-port&quot; signal" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-mapped-external-port"/>
17 <keyword type="property" name="The &quot;main-context&quot; property" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd--main-context"/>
18 <keyword type="property" name="The &quot;request-timeout&quot; property" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd--request-timeout"/>
19 <keyword type="signal" name="The &quot;error-mapping-port&quot; signal" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-error-mapping-port"/>
20 <keyword type="signal" name="The &quot;mapped-external-port&quot; signal" link="GUPnPSimpleIgd.html#GUPnPSimpleIgd-mapped-external-port"/>
2121 <keyword type="struct" name="GUPnPSimpleIgdThread" link="GUPnPSimpleIgdThread.html#GUPnPSimpleIgdThread-struct"/>
2222 <keyword type="struct" name="GUPnPSimpleIgdThreadClass" link="GUPnPSimpleIgdThread.html#GUPnPSimpleIgdThreadClass"/>
2323 <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"/>
2425 </functions>
2526 </book>
55 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
66 <link rel="start" href="index.html" title="GUPnP IGD Reference Manual">
77 <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)">
99 <link rel="stylesheet" href="style.css" type="text/css">
1010 <link rel="chapter" href="ch01.html" title="Simple IGD module">
1111 </head>
1515 <div>
1616 <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>
1717 <div><p class="releaseinfo">
18 for gupnp-igd 0.1.1
18 for gupnp-igd 0.1.3
1919
2020 </p></div>
2121 <div><p class="copyright">Copyright © 2008 Collabora Ltd, Nokia Corp</p></div>
3636 </div>
3737 <div class="footer">
3838 <hr>
39 Generated by GTK-Doc V1.10</div>
39 Generated by GTK-Doc V1.11</div>
4040 </body>
4141 </html>
66 <ANCHOR id="GUPnPSimpleIgd.details" href="gupnp-igd/GUPnPSimpleIgd.html#GUPnPSimpleIgd.details">
77 <ANCHOR id="GUPnPSimpleIgd-struct" href="gupnp-igd/GUPnPSimpleIgd.html#GUPnPSimpleIgd-struct">
88 <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">
1010 <ANCHOR id="GUPnPSimpleIgdError" href="gupnp-igd/GUPnPSimpleIgd.html#GUPnPSimpleIgdError">
1111 <ANCHOR id="gupnp-simple-igd-new" href="gupnp-igd/GUPnPSimpleIgd.html#gupnp-simple-igd-new">
1212 <ANCHOR id="gupnp-simple-igd-add-port" href="gupnp-igd/GUPnPSimpleIgd.html#gupnp-simple-igd-add-port">
5555 {
5656 color: #770000;
5757 font-size: 80%;
58 white-space: nowrap;
5859 }
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
6061 {
6162 position: relative;
6263 top: 3em;
64 z-index: 0;
65 }
66 div.glossary, div.index
67 {
68 position: relative;
69 top: 2em;
6370 z-index: 0;
6471 }
6572 div.refnamediv
0 0.1.2
0 0.1.3
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>
1212 <refnamediv>
1313 <refname>GUPnPSimpleIgdThread</refname>
1414 <refpurpose>Threaded wrapper for GUPnPSimpleIgd</refpurpose>
15 <!--[<xref linkend="desc" endterm="desc.title"/>]-->
1615 </refnamediv>
1716
1817 <refsynopsisdiv id="GUPnPSimpleIgdThread.synopsis" role="synopsis">
2120 <synopsis>
2221 <link linkend="GUPnPSimpleIgdThread-struct">GUPnPSimpleIgdThread</link>;
2322 <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);
2524 </synopsis>
2625 </refsynopsisdiv>
2726
3231 +----<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link>
3332 +----GUPnPSimpleIgdThread
3433 </synopsis>
35
3634 </refsect1>
3735
3836
4846 This wraps a <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> into a thread so that it can be used without
4947 having a <link linkend="GMainLoop"><type>GMainLoop</type></link> running.</para>
5048 <para>
51
5249 </para>
5350 </refsect1>
5451
5653 <title role="details.title">Details</title>
5754 <refsect2 id="GUPnPSimpleIgdThread-struct" role="struct">
5855 <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>
6057 <para>
6158 All members are private, access them using methods and properties</para>
6259 <para>
63
6460 </para></refsect2>
6561 <refsect2 id="GUPnPSimpleIgdThreadClass" role="struct">
6662 <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 {
6864 GUPnPSimpleIgdClass parent_class;
6965
7066 /*virtual functions */
7369 <para>
7470 The Raw UDP component transmitter class</para>
7571 <para>
76
7772 </para><variablelist role="struct">
7873 <varlistentry>
79 <term><link linkend="GUPnPSimpleIgdClass">GUPnPSimpleIgdClass</link>&nbsp;<structfield>parent_class</structfield>;</term>
74 <term><link linkend="GUPnPSimpleIgdClass">GUPnPSimpleIgdClass</link>&#160;<structfield>parent_class</structfield>;</term>
8075 <listitem><simpara> Our parent
8176 </simpara></listitem>
8277 </varlistentry>
8378 </variablelist></refsect2>
8479 <refsect2 id="gupnp-simple-igd-thread-new" role="function">
8580 <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>
8782 <para>
8883 Creates a new <link linkend="GUPnPSimpleIgdThread"><type>GUPnPSimpleIgdThread</type></link></para>
8984 <para>
90
9185 </para><variablelist role="params">
92 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the new <link linkend="GUPnPSimpleIgdThread"><type>GUPnPSimpleIgdThread</type></link>
86 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the new <link linkend="GUPnPSimpleIgdThread"><type>GUPnPSimpleIgdThread</type></link>
9387 </simpara></listitem></varlistentry>
9488 </variablelist></refsect2>
9589
1212 <refnamediv>
1313 <refname>GUPnPSimpleIgd</refname>
1414 <refpurpose>A simple class to map ports on UPnP routers</refpurpose>
15 <!--[<xref linkend="desc" endterm="desc.title"/>]-->
1615 </refnamediv>
1716
1817 <refsynopsisdiv id="GUPnPSimpleIgd.synopsis" role="synopsis">
2120 <synopsis>
2221 <link linkend="GUPnPSimpleIgd-struct">GUPnPSimpleIgd</link>;
2322 <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>
2524 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);
2726 <link linkend="void">void</link> <link linkend="gupnp-simple-igd-add-port">gupnp_simple_igd_add_port</link> (<link linkend="GUPnPSimpleIgd">GUPnPSimpleIgd</link> *self,
2827 const <link linkend="gchar">gchar</link> *protocol,
2928 <link linkend="guint16">guint16</link> external_port,
4443 +----GUPnPSimpleIgd
4544 +----<link linkend="GUPnPSimpleIgdThread">GUPnPSimpleIgdThread</link>
4645 </synopsis>
47
4846 </refsect1>
4947
5048
7674 It also allows implementations to know the external port from the router's
7775 perspective.</para>
7876 <para>
79
8077 </para>
8178 </refsect1>
8279
8481 <title role="details.title">Details</title>
8582 <refsect2 id="GUPnPSimpleIgd-struct" role="struct">
8683 <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>
8885 <para>
8986 All members are private, access them using methods and properties</para>
9087 <para>
91
9288 </para></refsect2>
9389 <refsect2 id="GUPnPSimpleIgdClass" role="struct">
9490 <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 {
9692 GObjectClass parent_class;
9793
9894 /*virtual functions */
113109 <para>
114110 The Raw UDP component transmitter class</para>
115111 <para>
116
117112 </para><variablelist role="struct">
118113 <varlistentry>
119 <term><link linkend="GObjectClass">GObjectClass</link>&nbsp;<structfield>parent_class</structfield>;</term>
114 <term><link linkend="GObjectClass">GObjectClass</link>&#160;<structfield>parent_class</structfield>;</term>
120115 <listitem><simpara> Our parent
121116 </simpara></listitem>
122117 </varlistentry>
123118 <varlistentry>
124 <term><structfield>add_port</structfield>&nbsp;()</term>
119 <term><structfield>add_port</structfield>&#160;()</term>
125120 <listitem><simpara> An implementation of the add_port function
126121 </simpara></listitem>
127122 </varlistentry>
128123 <varlistentry>
129 <term><structfield>remove_port</structfield>&nbsp;()</term>
124 <term><structfield>remove_port</structfield>&#160;()</term>
130125 <listitem><simpara> An implementation of the delete_port function
131126 </simpara></listitem>
132127 </varlistentry>
133128 </variablelist></refsect2>
134 <refsect2 id="GUPNP-SIMPLE-IGD-ERROR:CAPS" role="macro">
129 <refsect2 id="GUPNP-SIMPLE-IGD-ERROR--CAPS" role="macro">
135130 <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 ())
137132 </programlisting>
138133 <para>
139134 The <link linkend="GError"><type>GError</type></link> domain for error coming out of GUPnpSimpleIGD</para>
140135 <para>
141
142136 </para></refsect2>
143137 <refsect2 id="GUPnPSimpleIgdError" role="enum">
144138 <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 {
146140 GUPNP_SIMPLE_IGD_ERROR_EXTERNAL_ADDRESS,
147141 } GUPnPSimpleIgdError;
148142 </programlisting>
149143 <para>
150144 Errors coming out of the GUPnPSimpleIGD object.</para>
151145 <para>
152
153146 </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">
155148 <term><literal>GUPNP_SIMPLE_IGD_ERROR_EXTERNAL_ADDRESS</literal></term>
156149 <listitem><simpara> Error getting the external
157150 address of the router
160153 </variablelist></refsect2>
161154 <refsect2 id="gupnp-simple-igd-new" role="function">
162155 <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>
164157 <para>
165158 This creates a new <link linkend="GUPnpSimpleIgd"><type>GUPnpSimpleIgd</type></link> object using the special GMainContext</para>
166159 <para>
167
168 </para><variablelist role="params">
169 <varlistentry><term><parameter>main_context</parameter>&nbsp;:</term>
160 </para><variablelist role="params">
161 <varlistentry><term><parameter>main_context</parameter>&#160;:</term>
170162 <listitem><simpara> the <link linkend="GMainContext"><type>GMainContext</type></link> to use (may be NULL for the default
171163 main context)
172164 </simpara></listitem></varlistentry>
173 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link>
165 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link>
174166 </simpara></listitem></varlistentry>
175167 </variablelist></refsect2>
176168 <refsect2 id="gupnp-simple-igd-add-port" role="function">
177169 <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,
179171 const <link linkend="gchar">gchar</link> *protocol,
180172 <link linkend="guint16">guint16</link> external_port,
181173 const <link linkend="gchar">gchar</link> *local_ip,
193185 <link linkend="GUPnPSimpleIgd-mapped-external-port"><type>"mapped-external-port"</type></link> will be emitted. These signals may
194186 be emitted multiple times if there are multiple routers present.</para>
195187 <para>
196
197 </para><variablelist role="params">
198 <varlistentry><term><parameter>self</parameter>&nbsp;:</term>
188 </para><variablelist role="params">
189 <varlistentry><term><parameter>self</parameter>&#160;:</term>
199190 <listitem><simpara> The <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> object
200191 </simpara></listitem></varlistentry>
201 <varlistentry><term><parameter>protocol</parameter>&nbsp;:</term>
192 <varlistentry><term><parameter>protocol</parameter>&#160;:</term>
202193 <listitem><simpara> the protocol "UDP" or "TCP"
203194 </simpara></listitem></varlistentry>
204 <varlistentry><term><parameter>external_port</parameter>&nbsp;:</term>
195 <varlistentry><term><parameter>external_port</parameter>&#160;:</term>
205196 <listitem><simpara> The port to try to open on the external device,
206197 0 means to try a random port if the same port as the local port is already
207198 taken
208199 </simpara></listitem></varlistentry>
209 <varlistentry><term><parameter>local_ip</parameter>&nbsp;:</term>
200 <varlistentry><term><parameter>local_ip</parameter>&#160;:</term>
210201 <listitem><simpara> The IP address to forward packets to (most likely the local ip address)
211202 </simpara></listitem></varlistentry>
212 <varlistentry><term><parameter>local_port</parameter>&nbsp;:</term>
203 <varlistentry><term><parameter>local_port</parameter>&#160;:</term>
213204 <listitem><simpara> The local port to forward packets to
214205 </simpara></listitem></varlistentry>
215 <varlistentry><term><parameter>lease_duration</parameter>&nbsp;:</term>
206 <varlistentry><term><parameter>lease_duration</parameter>&#160;:</term>
216207 <listitem><simpara> The duration of the lease (it will be auto-renewed before it expires). This is in seconds.
217208 </simpara></listitem></varlistentry>
218 <varlistentry><term><parameter>description</parameter>&nbsp;:</term>
209 <varlistentry><term><parameter>description</parameter>&#160;:</term>
219210 <listitem><simpara> The description that will appear in the router's table
220211 </simpara></listitem></varlistentry>
221212 </variablelist></refsect2>
222213 <refsect2 id="gupnp-simple-igd-remove-port" role="function">
223214 <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,
225216 const <link linkend="gchar">gchar</link> *protocol,
226217 <link linkend="guint">guint</link> external_port);</programlisting>
227218 <para>
230221 it is a best effort mechanism. If it fails, the bindings will disapears after
231222 the lease duration set when the port where added.</para>
232223 <para>
233
234 </para><variablelist role="params">
235 <varlistentry><term><parameter>self</parameter>&nbsp;:</term>
224 </para><variablelist role="params">
225 <varlistentry><term><parameter>self</parameter>&#160;:</term>
236226 <listitem><simpara> The <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> object
237227 </simpara></listitem></varlistentry>
238 <varlistentry><term><parameter>protocol</parameter>&nbsp;:</term>
228 <varlistentry><term><parameter>protocol</parameter>&#160;:</term>
239229 <listitem><simpara> the protocol "UDP" or "TCP" as given to
240230 <link linkend="gupnp-simple-igd-add-port"><function>gupnp_simple_igd_add_port()</function></link>
241231 </simpara></listitem></varlistentry>
242 <varlistentry><term><parameter>external_port</parameter>&nbsp;:</term>
232 <varlistentry><term><parameter>external_port</parameter>&#160;:</term>
243233 <listitem><simpara> The port to try to open on the external device as given to
244234 <link linkend="gupnp-simple-igd-add-port"><function>gupnp_simple_igd_add_port()</function></link>
245235 </simpara></listitem></varlistentry>
248238 </refsect1>
249239 <refsect1 id="GUPnPSimpleIgd.property-details" role="property_details">
250240 <title role="property_details.title">Property Details</title>
251 <refsect2 id="GUPnPSimpleIgd--main-context"><title>The <literal>&quot;main-context&quot;</literal> property</title>
252 <indexterm zone="GUPnPSimpleIgd--main-context"><primary>GUPnPSimpleIgd:main-context</primary></indexterm><programlisting> &quot;main-context&quot; <link linkend="gpointer">gpointer</link> : Read / Write / Construct Only</programlisting>
241 <refsect2 id="GUPnPSimpleIgd--main-context" role="property"><title>The <literal>&quot;main-context&quot;</literal> property</title>
242 <indexterm zone="GUPnPSimpleIgd--main-context"><primary sortas="GUPnPSimpleIgd:main-context">GUPnPSimpleIgd:main-context</primary></indexterm><programlisting> &quot;main-context&quot; <link linkend="gpointer">gpointer</link> : Read / Write / Construct Only</programlisting>
253243 <para>This GMainContext will be used for all async activities.</para></refsect2>
254 <refsect2 id="GUPnPSimpleIgd--request-timeout"><title>The <literal>&quot;request-timeout&quot;</literal> property</title>
255 <indexterm zone="GUPnPSimpleIgd--request-timeout"><primary>GUPnPSimpleIgd:request-timeout</primary></indexterm><programlisting> &quot;request-timeout&quot; <link linkend="guint">guint</link> : Read / Write</programlisting>
244 <refsect2 id="GUPnPSimpleIgd--request-timeout" role="property"><title>The <literal>&quot;request-timeout&quot;</literal> property</title>
245 <indexterm zone="GUPnPSimpleIgd--request-timeout"><primary sortas="GUPnPSimpleIgd:request-timeout">GUPnPSimpleIgd:request-timeout</primary></indexterm><programlisting> &quot;request-timeout&quot; <link linkend="guint">guint</link> : Read / Write</programlisting>
256246 <para>After this timeout, the request is considered to have failed andis dropped (in seconds).</para><para>Default value: 5</para>
257247 </refsect2>
258
259248 </refsect1>
260249
261250 <refsect1 id="GUPnPSimpleIgd.signal-details" role="signals">
262251 <title role="signals.title">Signal Details</title>
263 <refsect2 id="GUPnPSimpleIgd-error-mapping-port"><title>The <literal>&quot;error-mapping-port&quot;</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>&quot;error-mapping-port&quot;</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,
265254 <link linkend="gpointer">gpointer</link> error,
266255 <link linkend="gchar">gchar</link> *proto,
267256 <link linkend="guint">guint</link> external_port,
273262 This means that mapping a port on a specific IGD has failed (it may still
274263 succeed on other IGDs on the network).</para>
275264 <para>
276
277 </para><variablelist role="params">
278 <varlistentry><term><parameter>self</parameter>&nbsp;:</term>
265 </para><variablelist role="params">
266 <varlistentry><term><parameter>self</parameter>&#160;:</term>
279267 <listitem><simpara> <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> that emitted the signal
280268 </simpara></listitem></varlistentry>
281 <varlistentry><term><parameter>error</parameter>&nbsp;:</term>
269 <varlistentry><term><parameter>error</parameter>&#160;:</term>
282270 <listitem><simpara> a <link linkend="GError"><type>GError</type></link>
283271 </simpara></listitem></varlistentry>
284 <varlistentry><term><parameter>proto</parameter>&nbsp;:</term>
272 <varlistentry><term><parameter>proto</parameter>&#160;:</term>
285273 <listitem><simpara> The requested protocol
286274 </simpara></listitem></varlistentry>
287 <varlistentry><term><parameter>external_port</parameter>&nbsp;:</term>
275 <varlistentry><term><parameter>external_port</parameter>&#160;:</term>
288276 <listitem><simpara> the external port requested in <link linkend="gupnp-simple-igd-add-port"><function>gupnp_simple_igd_add_port()</function></link>
289277 </simpara></listitem></varlistentry>
290 <varlistentry><term><parameter>local_ip</parameter>&nbsp;:</term>
278 <varlistentry><term><parameter>local_ip</parameter>&#160;:</term>
291279 <listitem><simpara> internal ip this is forwarded to
292280 </simpara></listitem></varlistentry>
293 <varlistentry><term><parameter>local_port</parameter>&nbsp;:</term>
281 <varlistentry><term><parameter>local_port</parameter>&#160;:</term>
294282 <listitem><simpara> the local port
295283 </simpara></listitem></varlistentry>
296 <varlistentry><term><parameter>description</parameter>&nbsp;:</term>
284 <varlistentry><term><parameter>description</parameter>&#160;:</term>
297285 <listitem><simpara> the passed description
298286 </simpara></listitem></varlistentry>
299 <varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
287 <varlistentry><term><parameter>user_data</parameter>&#160;:</term>
300288 <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>&quot;mapped-external-port&quot;</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>&quot;mapped-external-port&quot;</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,
303291 <link linkend="gchar">gchar</link> *proto,
304292 <link linkend="gchar">gchar</link> *external_ip,
305293 <link linkend="gchar">gchar</link> *replaces_external_ip,
312300 This signal means that an IGD has been found that that adding a port
313301 mapping has succeeded.</para>
314302 <para>
315
316 </para><variablelist role="params">
317 <varlistentry><term><parameter>self</parameter>&nbsp;:</term>
303 </para><variablelist role="params">
304 <varlistentry><term><parameter>self</parameter>&#160;:</term>
318305 <listitem><simpara> <link linkend="GUPnPSimpleIgd"><type>GUPnPSimpleIgd</type></link> that emitted the signal
319306 </simpara></listitem></varlistentry>
320 <varlistentry><term><parameter>proto</parameter>&nbsp;:</term>
307 <varlistentry><term><parameter>proto</parameter>&#160;:</term>
321308 <listitem><simpara> the requested protocol ("UDP" or "TCP")
322309 </simpara></listitem></varlistentry>
323 <varlistentry><term><parameter>external_ip</parameter>&nbsp;:</term>
310 <varlistentry><term><parameter>external_ip</parameter>&#160;:</term>
324311 <listitem><simpara> the external IP
325312 </simpara></listitem></varlistentry>
326 <varlistentry><term><parameter>replaces_external_ip</parameter>&nbsp;:</term>
313 <varlistentry><term><parameter>replaces_external_ip</parameter>&#160;:</term>
327314 <listitem><simpara> if this mapping replaces another mapping,
328315 this is the old external IP
329316 </simpara></listitem></varlistentry>
330 <varlistentry><term><parameter>external_port</parameter>&nbsp;:</term>
317 <varlistentry><term><parameter>external_port</parameter>&#160;:</term>
331318 <listitem><simpara> the external port that was allocated
332319 </simpara></listitem></varlistentry>
333 <varlistentry><term><parameter>local_ip</parameter>&nbsp;:</term>
320 <varlistentry><term><parameter>local_ip</parameter>&#160;:</term>
334321 <listitem><simpara> internal ip this is forwarded to
335322 </simpara></listitem></varlistentry>
336 <varlistentry><term><parameter>local_port</parameter>&nbsp;:</term>
323 <varlistentry><term><parameter>local_port</parameter>&#160;:</term>
337324 <listitem><simpara> the local port
338325 </simpara></listitem></varlistentry>
339 <varlistentry><term><parameter>description</parameter>&nbsp;:</term>
326 <varlistentry><term><parameter>description</parameter>&#160;:</term>
340327 <listitem><simpara> the user's selected description
341328 </simpara></listitem></varlistentry>
342 <varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
329 <varlistentry><term><parameter>user_data</parameter>&#160;:</term>
343330 <listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
344331 </variablelist></refsect2>
345332 </refsect1>
66 if GTK_DOC_USE_LIBTOOL
77 GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
88 GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
9 GTKDOC_RUN = $(LIBTOOL) --mode=execute
910 else
1011 GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
1112 GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
13 GTKDOC_RUN = sh -c
1214 endif
1315
1416 # We set GPATH here; this gives us semantics for GNU make
5254
5355 docs: html-build.stamp
5456
57 $(REPORT_FILES): sgml-build.stamp
58
5559 #### scan ####
5660
5761 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
6064 cd $(srcdir) && \
6165 gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
6266 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) ; \
6468 else \
6569 cd $(srcdir) ; \
6670 for i in $(SCANOBJ_FILES) ; do \
106110 @-chmod -R u+w $(srcdir)
107111 rm -rf $(srcdir)/html
108112 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)
110119 test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
111120 @echo 'gtk-doc: Fixing cross-references'
112121 cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
127136 cd $(srcdir) && rm -rf xml html
128137
129138 install-data-local:
130 -installfiles=`echo $(srcdir)/html/*`; \
139 installfiles=`echo $(srcdir)/html/*`; \
131140 if test "$$installfiles" = '$(srcdir)/html/*'; \
132141 then echo '-- Nothing to install' ; \
133142 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} ; \
135149 for i in $$installfiles; do \
136150 echo '-- Installing '$$i ; \
137 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
151 $(INSTALL_DATA) $$i $${installdir}; \
138152 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} ; \
143161 fi
144
145162
146163 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}
148170
149171 #
150172 # Require gtk-doc when making dist
167189 -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
168190 -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
169191 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
171194
172195 .PHONY : dist-hook-local docs
00 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@
44
55 Name: gupnp-igd-1.0
66 Description: GUPnP Simple IGD library
33 # interfaces added -> increment AGE
44 # interfaces removed -> AGE = 0
55
6 LTVERSION = 2:0:0
6 LTVERSION = 2:1:0
77
88 AM_CFLAGS = $(LIBGUPNP_CFLAGS) -I$(top_srcdir)
99
202202 top_build_prefix = @top_build_prefix@
203203 top_builddir = @top_builddir@
204204 top_srcdir = @top_srcdir@
205 LTVERSION = 2:0:0
205 LTVERSION = 2:1:0
206206 AM_CFLAGS = $(LIBGUPNP_CFLAGS) -I$(top_srcdir)
207207 libgupnp_igd_incdir = $(includedir)/gupnp-igd-1.0/libgupnp-igd
208208 lib_LTLIBRARIES = libgupnp-igd-1.0.la
3131
3232 #include "gupnp-simple-igd-thread.h"
3333
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 };
4145
4246 struct _GUPnPSimpleIgdThreadPrivate
4347 {
4448 GThread *thread;
4549 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;
5156 };
5257
5358
5560 (G_TYPE_INSTANCE_GET_PRIVATE ((o), GUPNP_TYPE_SIMPLE_IGD_THREAD, \
5661 GUPnPSimpleIgdThreadPrivate))
5762
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)
6067
6168
6269 G_DEFINE_TYPE (GUPnPSimpleIgdThread, gupnp_simple_igd_thread,
99106 {
100107 self->priv = GUPNP_SIMPLE_IGD_THREAD_GET_PRIVATE (self);
101108
102 self->priv->mutex = g_mutex_new ();
103109 self->priv->context = g_main_context_new ();
110 self->priv->can_dispose_cond = g_cond_new ();
104111
105112 g_object_set (self, "main-context", self->priv->context, NULL);
106113 }
107114
108115 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
114130 return FALSE;
115131 }
116132
117
118133 static void
119134 gupnp_simple_igd_thread_dispose (GObject *object)
120135 {
121136 GUPnPSimpleIgdThread *self = GUPNP_SIMPLE_IGD_THREAD_CAST (object);
122137
123138 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
125152 {
126153 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;
135182 }
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;
141183
142184 G_OBJECT_CLASS (gupnp_simple_igd_thread_parent_class)->dispose (object);
143185 }
144186
145187 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
146199 gupnp_simple_igd_thread_finalize (GObject *object)
147200 {
148201 GUPnPSimpleIgdThread *self = GUPNP_SIMPLE_IGD_THREAD_CAST (object);
149202
150203 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);
152207
153208 G_OBJECT_CLASS (gupnp_simple_igd_thread_parent_class)->finalize (object);
154209 }
155210
156211 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);
174227
175228 g_main_loop_unref (loop);
176229
230 thread_data_dec (data);
231
177232 return NULL;
178233 }
179234
181236 gupnp_simple_igd_thread_constructed (GObject *object)
182237 {
183238 GUPnPSimpleIgdThread *self = GUPNP_SIMPLE_IGD_THREAD_CAST (object);
239 struct thread_data *data = g_slice_new0 (struct thread_data);
184240
185241 if (G_OBJECT_CLASS (gupnp_simple_igd_thread_parent_class)->constructed)
186242 G_OBJECT_CLASS (gupnp_simple_igd_thread_parent_class)->constructed (object);
187243
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);
189253 g_return_if_fail (self->priv->thread);
190254 }
191255
5656
5757 gulong ppp_avail_handler;
5858 gulong ppp_unavail_handler;
59
60 guint deleting_count;
5961 };
6062
6163 struct Proxy {
133135 struct Mapping *mapping);
134136
135137 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);
139141
140142 static void gupnp_simple_igd_add_port_real (GUPnPSimpleIgd *self,
141143 const gchar *protocol,
246248 self->priv->mappings = g_ptr_array_new ();
247249 }
248250
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 {
254264 if (self->priv->ip_avail_handler)
255265 g_signal_handler_disconnect (self->priv->ip_cp,
256266 self->priv->ip_avail_handler);
273283
274284 while (self->priv->mappings->len)
275285 {
276 free_mapping (
277 g_ptr_array_index (self->priv->mappings, 0));
286 free_mapping (self, g_ptr_array_index (self->priv->mappings, 0));
278287 g_ptr_array_remove_index_fast (self->priv->mappings, 0);
279288 }
280289
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
281301 while (self->priv->service_proxies->len)
282302 {
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));
285304 g_ptr_array_remove_index_fast (self->priv->service_proxies, 0);
286305 }
287306
334353 }
335354
336355 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
339397 g_slice_free (struct ProxyMapping, pm);
340398 }
341399
348406 gupnp_service_proxy_remove_notify (prox->proxy, "ExternalIPAddress",
349407 _external_ip_address_changed, prox);
350408
351 g_object_unref (prox->proxy);
352 g_ptr_array_foreach (prox->proxymappings, (GFunc) stop_proxymapping, NULL);
353409 g_ptr_array_foreach (prox->proxymappings, (GFunc) free_proxymapping, NULL);
354410 g_ptr_array_free (prox->proxymappings, TRUE);
411 g_object_unref (prox->proxy);
355412 g_free (prox->external_ip);
356413 g_slice_free (struct Proxy, prox);
357414 }
358415
359416 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
362437 g_free (mapping->protocol);
363438 g_free (mapping->local_ip);
364439 g_free (mapping->description);
469544 if (!strcmp (gupnp_service_info_get_udn (GUPNP_SERVICE_INFO (prox->proxy)),
470545 gupnp_service_info_get_udn (GUPNP_SERVICE_INFO (prox->proxy))))
471546 {
472 g_ptr_array_foreach (prox->proxymappings, (GFunc) stop_proxymapping,
473 NULL);
474 g_ptr_array_foreach (prox->proxymappings, (GFunc) free_proxymapping,
475 NULL);
476547 free_proxy (prox);
477548 g_ptr_array_remove_index_fast (self->priv->service_proxies, i);
478549 break;
652723 gupnp_simple_igd_call_add_port_mapping (struct ProxyMapping *pm,
653724 GUPnPServiceProxyActionCallback callback)
654725 {
726 g_assert (pm);
655727 g_return_if_fail (pm->action == NULL);
728 g_assert (pm->proxy);
729 g_assert (pm->mapping);
656730
657731 pm->action = gupnp_service_proxy_begin_action (pm->proxy->proxy,
658732 "AddPortMapping",
673747 {
674748 struct ProxyMapping *pm = user_data;
675749
676 stop_proxymapping (pm);
750 stop_proxymapping (pm, FALSE);
677751
678752 gupnp_simple_igd_call_add_port_mapping (pm,
679753 _service_proxy_renewed_port_mapping);
707781
708782
709783
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 }
716792 }
717793 else
718794 {
847923 lease_duration, description);
848924 }
849925
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
868926 static void
869927 gupnp_simple_igd_remove_port_real (GUPnPSimpleIgd *self,
870928 const gchar *protocol,
871929 guint external_port)
872930 {
873 guint i, j;
874931 struct Mapping *mapping = NULL;
932 guint i;
875933
876934 g_return_if_fail (protocol);
877935
890948
891949 g_ptr_array_remove_index_fast (self->priv->mappings, i);
892950
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);
928952 }
929953
930954 /**
953977 }
954978
955979 static void
956 stop_proxymapping (struct ProxyMapping *pm)
980 stop_proxymapping (struct ProxyMapping *pm, gboolean stop_renew)
957981 {
958982 if (pm->action)
959983 gupnp_service_proxy_cancel_action (pm->proxy->proxy,
960984 pm->action);
961985 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 }
133133 const gchar *protocol,
134134 guint external_port);
135135
136
137 gboolean
138 gupnp_simple_igd_delete_all_mappings (GUPnPSimpleIgd *self);
139
140
136141 G_END_DECLS
137142
138143 #endif /* __GUPNP_SIMPLE_IGD_H__ */
4747 static GUPnPServiceInfo *ipservice = NULL;
4848 static GUPnPServiceInfo *pppservice = NULL;
4949
50 gboolean return_conflict = 0;
50 gboolean return_conflict = FALSE;
51 gboolean dispose_removes = FALSE;
5152
5253
5354 static void
191192 !strcmp (external_ip, IP_ADDRESS_SECOND)) ||
192193 (!strcmp (replaces_external_ip, PPP_ADDRESS_FIRST) &&
193194 !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);
195199 }
196200 else
197201 {
285289 INTERNAL_PORT, 10, "GUPnP Simple IGD test");
286290
287291 loop = g_main_loop_new (mainctx, FALSE);
288
289292 g_main_loop_run (loop);
293 g_main_loop_unref (loop);
290294
291295 g_object_unref (context);
296
292297 }
293298
294299 static void
344349 return_conflict = FALSE;
345350 g_object_unref (igd);
346351 }
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
347377
348378
349379 int main (int argc, char **argv)
360390 test_gupnp_simple_igd_random_no_conflict);
361391 g_test_add_func ("/simpleigd/random/conflict",
362392 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);
363397
364398 g_test_run ();
365399