Projects
openEuler:Mainline
gupnp-igd
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 10
View file
_service:tar_scm:gupnp-igd.spec
Changed
@@ -1,12 +1,14 @@ Name: gupnp-igd -Version: 1.2.0 +Version: 1.6.0 Release: 1 Summary: Library for handling port mapping between UPnP and IGD License: LGPLv2+ URL: https://wiki.gnome.org/Projects/GUPnP Source0: https://download.gnome.org/sources/%{name}/1.2/%{name}-%{version}.tar.xz -BuildRequires: glib2-devel gobject-introspection-devel gtk-doc gupnp-devel meson +BuildRequires: glib2-devel gobject-introspection-devel gtk-doc meson +BuildRequires: cmake +BuildRequires: gupnp-devel Provides: %{name}-python = %{version}-%{release} %{name}-python2 = %{version}-%{release} Obsoletes: %{name}-python < %{version}-%{release} %{name}-python2 < %{version}-%{release} @@ -31,25 +33,31 @@ %install %meson_install +cp %{_libdir}/libgupnp-igd-1.0.so.* %{buildroot}%{_libdir}/ %post -p /sbin/ldconfig %postun -p /sbin/ldconfig + + %files %license COPYING %doc README %{_libdir}/*.so.* -%{_libdir}/girepository-1.0/GUPnPIgd-1.0.typelib +%{_libdir}/girepository-1.0/GUPnPIgd-1.6.typelib %files devel %{_includedir}/* %{_libdir}/*.so -%{_libdir}/pkgconfig/%{name}-1.0*.pc +%{_libdir}/pkgconfig/%{name}-1.6*.pc %{_datadir}/gtk-doc/html/%{name}/ -%{_datadir}/gir-1.0/GUPnPIgd-1.0.gir +%{_datadir}/gir-1.0/GUPnPIgd-1.6.gir %changelog +* Mon Aug 07 2023 xu_ping <707078654@qq.com> - 1.6.0-1 +- Update version to 1.6.0 + * Thu Jun 24 2021 Wenlong Ding <wenlong.ding@turbolinux.com.cn> - 1.2.0-1 - Update to 1.2.0
View file
_service:tar_scm:gupnp-igd-1.6.0.tar.xz/.gitignore
Added
@@ -0,0 +1,70 @@ +*.lo +*.loT +*.o +*.la +Makefile +Makefile.in +.deps +.libs +*~ +*# +.#* +*.stamp +*.gir +*.typelib +*.log +*.trs +*.test + +aclocal.m4 +autom4te.cache +autoregen.sh +config.guess +config.h +config.h.in +config.log +config.status +config.sub +configure +compile +depcomp +diff +install-sh +libtool +ltmain.sh +mkinstalldirs +missing +py-compile +stamp-h.in +stamp-h1 +test-driver + +gtk-doc.make +gupnp-igd-1.6-uninstalled.pc +gupnp-igd-1.6.pc + +libgupnp-igd/gupnp-simple-igd-marshal.ch + +tests/examples/test +tests/examples/test-thread + +tests/gtest/gupnp-simple-igd + +doc/gupnp-igd-decl-list.txt +doc/gupnp-igd-decl.txt +doc/gupnp-igd-overrides.txt +doc/gupnp-igd-undeclared.txt +doc/gupnp-igd-undocumented.txt +doc/gupnp-igd-unused.txt +doc/gupnp-igd.args +doc/gupnp-igd.hierarchy +doc/gupnp-igd.interfaces +doc/gupnp-igd.prerequisites +doc/gupnp-igd.signals +doc/gupnp-igd.types +doc/html/ +doc/tmpl/ +doc/version.xml +doc/xml/ + +python/pygupnp-igd.c
View file
_service:tar_scm:gupnp-igd-1.6.0.tar.xz/.gitlab-ci.yml
Added
@@ -0,0 +1,195 @@ +include: + - remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/0c312d9c7255f46e741d43bcd1930f09cd12efe7/templates/ci-fairy.yml" + - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/0c312d9c7255f46e741d43bcd1930f09cd12efe7/templates/fedora.yml' + +variables: + MESON_TEST_TIMEOUT_MULTIPLIER: 3 + +stages: + - review + - prepare + - build + - test + - analysis + - website + +.check-template: &check + extends: + - .fdo.ci-fairy + artifacts: + expire_in: 1 week + paths: + - check-junit-report.xml + reports: + junit: check-junit-report.xml + +check-commit-log: + variables: + GIT_DEPTH: "100" + stage: review + script: + - if x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ; + then + ci-fairy check-commits --junit-xml=check-junit-report.xml ; + else + echo "Not a merge request" ; + fi + <<: *check + +check-merge-request: + variables: + GIT_STRATEGY: none + stage: review + script: + - if x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ; + then + ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-junit-report.xml ; + else + echo "Not a merge request" ; + fi + <<: *check + +.build-template: &build + stage: build + script: + - meson . build --prefix=/usr -Db_coverage=true + - ninja -C build + artifacts: + expire_in: 1 day + paths: + - build + +.gupnp.fedora@common: + variables: + BASE_TAG: '2022-05-25.0' + FDO_UPSTREAM_REPO: GNOME/gupnp-igd + FDO_DISTRIBUTION_PACKAGES: 'clang clang-analyzer gcovr git libasan libubsan python3-gobject python3-pip xmlto gobject-introspection-devel gtk-doc libsoup3-devel libuuid-devel libxml2-devel vala ninja-build python3-setuptools' + FDO_DISTRIBUTION_EXEC: | + dnf clean all && + pip3 install meson markdown gi-docgen jinja2 Markdown markupsafe pygments toml typogrify + +.gupnp.fedora:36@x86_64: + extends: .gupnp.fedora@common + variables: + FDO_DISTRIBUTION_VERSION: 36 + FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}" + +build-fedora-container@x86_64: + extends: + - .fdo.container-build@fedora + - .gupnp.fedora:36@x86_64 + stage: prepare + variables: + GIT_STRATEGY: none + + +build-fedora@x86_64: + extends: + - .fdo.distribution-image@fedora + - .gupnp.fedora:36@x86_64 + needs: + - build-fedora-container@x86_64 + <<: *build + + +.test-template: &test + stage: test + variables: + G_SLICE: "always-malloc" + MALLOC_CHECK_: "3" + script: + - cd build + - | + # Remove the many "CI_" variables from the environment. Meson dumps the + # whole environment for every failed test, and that gives a whole + # screenful of junk each time unless we strip these. + unset $(env|grep -o '^CI_^=*') + env LANG=C.UTF-8 LC_ALL=C.UTF-8 meson test --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER} --print-errorlogs ${MESON_TEST_EXTRA_ARGS} + after_script: + - | + echo "Distribution: " + echo + egrep '^NAME=|^VERSION=' /etc/os-release + echo + echo "Test suite settings:" + echo + echo "G_MESSAGES_DEBUG: ${G_MESSAGES_DEBUG}" + echo "MESON_TEST_EXTRA_ARGS: ${MESON_TEST_EXTRA_ARGS}" + echo + echo "These values can be set at https://gitlab.gnome.org/GNOME/gupnp-igd/pipelines/new" + artifacts: + expire_in: 1 day + when: always + paths: + - build + reports: + junit: "build/meson-logs/testlog.junit.xml" + +test-fedora@x86_64: + extends: + - .fdo.distribution-image@fedora + - .gupnp.fedora:36@x86_64 + needs: + - build-fedora@x86_64 + <<: *test + + #trigger-rygel: + #stage: analysis + #needs: + # - test-fedora@x86_64 + #trigger: GNOME/rygel + #only: + # - master + +coverage-analysis: + extends: + - .fdo.distribution-image@fedora + - .gupnp.fedora:36@x86_64 + stage: analysis + allow_failure: true + script: + - cd build + - mkdir -p coveragereport + - gcovr --html-details --print-summary --root=.. --exclude=../build --exclude=../subprojects --exclude=../docs/reference --exclude=../tests --exclude=../tools --exclude=../examples --output coveragereport/index.html + coverage: '/^lines: (\d+\.\d+\%)/' + artifacts: + when: always + paths: + - build/coveragereport + needs: + - test-fedora@x86_64 + +static-scan: + extends: + - .fdo.distribution-image@fedora + - .gupnp.fedora:36@x86_64 + stage: analysis + needs: + - build-fedora-container@x86_64 + script: + - meson --buildtype=debug _scan_build + - ninja -C _scan_build scan-build + artifacts: + paths: + - _scan_build/meson-logs + allow_failure: true + +pages: + extends: + - .fdo.distribution-image@fedora + - .gupnp.fedora:36@x86_64 + stage: website + script: + - meson doc-build -Dgtk_doc=true + - ninja -C doc-build gupnp-igd-doc + - mkdir -p public + - mv doc-build/doc/html public/docs + artifacts: + paths: + - public + needs: + - build-fedora-container@x86_64 + only: + - master + - /^wip\/.*\/ci.*$/ +
View file
_service:tar_scm:gupnp-igd-1.2.0.tar.xz/NEWS -> _service:tar_scm:gupnp-igd-1.6.0.tar.xz/NEWS
Changed
@@ -1,5 +1,13 @@ ******************* -* GUPnP IGD 1.20 * +* GUPnP IGD 1.6.0 * +******************* + +- Switch to GUPnP 1.2.0 API +- Update GLib dependency to 2.70 +- Add Javascript example + +******************* +* GUPnP IGD 1.2.0 * ******************* - Switch to GUPnP 1.2.0 API
View file
_service:tar_scm:gupnp-igd-1.2.0.tar.xz/README -> _service:tar_scm:gupnp-igd-1.6.0.tar.xz/README
Changed
@@ -1,9 +1,9 @@ This is a library to handle UPnP IGD port mapping. -It was written by Olivier Crête <olivier.crete@collabora.co.uk>. +It was written by Olivier Crête <olivier.crete@collabora.com>. It is supposed to have a very simple API. Read the gtk-doc. The only dependencies are: - - GUPnP 1.2 + - GUPnP 1.6 - GLib 2.38
View file
_service:tar_scm:gupnp-igd-1.6.0.tar.xz/examples
Added
+(directory)
View file
_service:tar_scm:gupnp-igd-1.6.0.tar.xz/examples/map-port.js
Added
@@ -0,0 +1,89 @@ +#!/usr/bin/env gjs +// +// Copyright (c) 2021, Sonny Piers <sonny@fastmail.net> +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +// DAMAGE. + +const { GUPnPIgd, GLib } = imports.gi; +const { system } = imports; + +const { SimpleIgd } = GUPnPIgd; +const { MainLoop } = GLib; + +const mainloop = new MainLoop(null, false); + +const protocol = "TCP"; +const external_port = 0; // 0 means local_port if available otherwise random port +const local_ip = ARGV0; +const local_port = ARGV1; +const lease_duration = 3000; // auto-renewed until port mapping is removed or process exits +const description = "gupnp-igd JavaScript example"; + +let exit_code = 0; + +if (!local_ip || !local_port) { + print("Usage: ./map-port.js IP PORT"); + system.exit(1); +} + +const simpleIgd = new SimpleIgd(); +simpleIgd.connect( + "error-mapping-port", + (self, error, proto, external_port, local_ip, local_port, description) => { + printerr(error); + exit_code = 1; + mainloop.quit(); + } +); + +simpleIgd.connect( + "mapped-external-port", + ( + self, + proto, + external_ip, + replaces_external_ip, + external_port, + local_ip, + local_port, + description + ) => { + print( + `success ${external_ip}:${external_port} -> ${local_ip}:${local_port}` + ); + } +); + +simpleIgd.add_port( + protocol, + external_port, + local_ip, + local_port, + lease_duration, + description +); + +mainloop.run(); +system.exit(exit_code);
View file
_service:tar_scm:gupnp-igd-1.2.0.tar.xz/gupnp-igd.doap -> _service:tar_scm:gupnp-igd-1.6.0.tar.xz/gupnp-igd.doap
Changed
@@ -32,13 +32,6 @@ </maintainer> <maintainer> <foaf:Person> - <foaf:name>Ross Burton</foaf:name> - <foaf:mbox rdf:resource="mailto:ross.burton@intel.com" /> - <gnome:userid>rburton</gnome:userid> - </foaf:Person> - </maintainer> - <maintainer> - <foaf:Person> <foaf:name>Olivier Crête</foaf:name> <foaf:mbox rdf:resource="mailto:olivier.crete@ocrete.ca" /> <gnome:userid>tester</gnome:userid>
View file
_service:tar_scm:gupnp-igd-1.2.0.tar.xz/libgupnp-igd/meson.build -> _service:tar_scm:gupnp-igd-1.6.0.tar.xz/libgupnp-igd/meson.build
Changed
@@ -9,7 +9,7 @@ 'gupnp-simple-igd-thread.h' ) -install_headers(headers, subdir: 'gupnp-igd-1.0/libgupnp-igd') +install_headers(headers, subdir: 'gupnp-igd-1.6/libgupnp-igd') sources = files( 'gupnp-enum-types.c', @@ -17,10 +17,13 @@ 'gupnp-simple-igd-thread.c' ) + +# Don't forget to update the 'version' + libgupnp_igd = library( - 'gupnp-igd-1.0', + 'gupnp-igd-1.6', sources + marshal, - version: '4.2.1', + version: '0.0.0', include_directories: include_directories('..'), dependencies : dependencies, c_args : '-D_LOG_DOMAIN=GUPnP-IGD', @@ -34,11 +37,11 @@ pkg.generate( libraries : libgupnp_igd, - name : 'gupnp-igd-1.0', - subdirs : 'gupnp-igd-1.0', - filebase : 'gupnp-igd-1.0', + name : 'gupnp-igd-1.6', + subdirs : 'gupnp-igd-1.6', + filebase : 'gupnp-igd-1.6', description: 'GUPnP Simple IGD library', - requires_private : 'gupnp-1.2' + requires_private : 'gupnp-1.6' ) @@ -47,11 +50,11 @@ libgupnp_igd, sources : headers + sources, namespace : 'GUPnPIgd', - nsversion : '1.0', + nsversion : '1.6', symbol_prefix: 'gupnp', identifier_prefix : 'GUPnP', install: true, - export_packages : 'gupnp-1.0', + export_packages : 'gupnp-1.6', includes : 'GObject-2.0' ) endif
View file
_service:tar_scm:gupnp-igd-1.2.0.tar.xz/meson.build -> _service:tar_scm:gupnp-igd-1.6.0.tar.xz/meson.build
Changed
@@ -1,14 +1,14 @@ -project('gupnp-igd', 'c', version: '1.2.0') +project('gupnp-igd', 'c', version: '1.6.0') gnome = import('gnome') pkg = import('pkgconfig') -glib_req = '>= 2.38' +glib_req = '>= 2.70' dependencies = dependency('glib-2.0', version: glib_req, required: true), dependency('gobject-2.0', version: glib_req, required: true), - dependency('gupnp-1.2', version : '>= 1.2.0'), - dependency('gssdp-1.2', version : '>= 1.2.0'), + dependency('gupnp-1.6', version : '>= 1.6.0'), + dependency('gssdp-1.6', version : '>= 1.6.0'), dependency('gthread-2.0', required: true)
View file
_service:tar_scm:gupnp-igd-1.6.0.tar.xz/subprojects
Added
+(directory)
View file
_service:tar_scm:gupnp-igd-1.6.0.tar.xz/subprojects/.gitignore
Added
@@ -0,0 +1,3 @@ +gupnp-1.6 +gi-docgen* +gssdp-1.6*
View file
_service:tar_scm:gupnp-igd-1.6.0.tar.xz/subprojects/gupnp-1.6.wrap
Added
@@ -0,0 +1,4 @@ +wrap-git +url = https://gitlab.gnome.org/GNOME/gupnp.git +revision = gupnp-1.6.3 +depth = 1
View file
_service:tar_scm:gupnp-igd-1.2.0.tar.xz/tests/gtest/gupnp-simple-igd.c -> _service:tar_scm:gupnp-igd-1.6.0.tar.xz/tests/gtest/gupnp-simple-igd.c
Changed
@@ -88,7 +88,7 @@ else g_assert_not_reached (); - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } @@ -139,7 +139,7 @@ if (return_conflict && external_port == INTERNAL_PORT) gupnp_service_action_return_error (action, 718, "ConflictInMappingEntry"); else - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } static gboolean @@ -172,7 +172,7 @@ g_assert (external_port != INTERNAL_PORT); g_assert (proto && !strcmp (proto, "UDP")); - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); g_free (remote_host); g_free (proto); @@ -182,12 +182,28 @@ g_source_attach (src, g_main_context_get_thread_default ()); } +typedef struct _MappedData { + GMainContext *context; + const char *ip_address; + guint port; +} MappedData; + +gboolean service_notify (gpointer user_data) { + MappedData *d = (MappedData *) user_data; + gupnp_service_notify (GUPNP_SERVICE (ipservice), + "ExternalIPAddress", G_TYPE_STRING, d->ip_address, NULL); + + return G_SOURCE_REMOVE; +} + static void mapped_external_port_cb (GUPnPSimpleIgd *igd, gchar *proto, gchar *external_ip, gchar *replaces_external_ip, guint external_port, gchar *local_ip, guint local_port, gchar *description, gpointer user_data) { - guint requested_external_port = GPOINTER_TO_UINT (user_data); + + MappedData *d = (MappedData *) user_data; + guint requested_external_port = d->port; g_assert (invalid_ip == NULL); @@ -218,13 +234,13 @@ } else { - if (!strcmp (external_ip, IP_ADDRESS_FIRST)) - gupnp_service_notify (GUPNP_SERVICE (ipservice), - "ExternalIPAddress", G_TYPE_STRING, IP_ADDRESS_SECOND, NULL); - else if (!strcmp (external_ip, PPP_ADDRESS_FIRST)) - gupnp_service_notify (GUPNP_SERVICE (pppservice), - "ExternalIPAddress", G_TYPE_STRING, PPP_ADDRESS_SECOND, NULL); - else + if (!strcmp (external_ip, IP_ADDRESS_FIRST)) { + d->ip_address = IP_ADDRESS_SECOND; + g_main_context_invoke(d->context, service_notify, d); + } else if (!strcmp (external_ip, PPP_ADDRESS_FIRST)) { + d->ip_address = PPP_ADDRESS_SECOND; + g_main_context_invoke(d->context, service_notify, d); + } else g_assert_not_reached (); } } @@ -274,25 +290,21 @@ GUPnPDeviceInfo *subdev2; const gchar *xml_path = "."; GError *error = NULL; + GInetAddress *loopback = NULL; g_signal_connect (igd, "context-available", G_CALLBACK (ignore_non_localhost), NULL); if (mainctx) g_main_context_push_thread_default (mainctx); - context = gupnp_context_new ("lo", 0, NULL); + loopback = g_inet_address_new_loopback (G_SOCKET_FAMILY_IPV4); + context = gupnp_context_new_for_address (loopback, 0, GSSDP_UDA_VERSION_1_0, NULL); + g_object_unref (loopback); g_assert (context); if (g_getenv ("XML_PATH")) xml_path = g_getenv ("XML_PATH"); - gupnp_context_host_path (context, xml_path, ""); - - /* - gupnp_context_host_path (context, "InternetGatewayDevice.xml", "/InternetGatewayDevice.xml"); - gupnp_context_host_path (context, "WANIPConnection.xml", "/WANIPConnection.xml"); - gupnp_context_host_path (context, "WANPPPConnection.xml", "/WANPPPConnection.xml"); - */ dev = gupnp_root_device_new (context, "InternetGatewayDevice.xml", xml_path, &error); g_assert (dev); @@ -333,9 +345,12 @@ gupnp_root_device_set_available (dev, TRUE); + MappedData d; + d.context = mainctx; + d.port = requested_port; g_signal_connect (igd, "mapped-external-port", - G_CALLBACK (mapped_external_port_cb), GUINT_TO_POINTER (requested_port)); + G_CALLBACK (mapped_external_port_cb), &d); g_signal_connect (igd, "error-mapping-port", G_CALLBACK (error_mapping_port_cb), NULL);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2