RepositoryC
pupnp

pupnp/pupnp

libupnp: Build UPnP-compliant control points, devices, and bridges on several operating systems.

444stars
141forks
3issues
3views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: ssdp

#1 Repository of the month

1
TINIX TRENDING·Topic: upnp

#1 Repository of the month

1
TINIX TRENDING·Topic: upnp-library

#1 Repository of the month

The Portable SDK for UPnP* Devices (libupnp)

branchstatus
main (2.0.x)main
branch-1.18.x1.18.x
branch-1.14.x1.14.x
branch-1.12.x1.12.x
branch-1.10.x1.10.x
branch-1.8.x1.8.x
branch-1.6.x1.6.x
branch-1.4.x1.4.x

Copyright (c) 2000-2003 Intel Corporation - All Rights Reserved.

Copyright (c) 2005-2006 Rémi Turboult r3mi@users.sourceforge.net

Copyright (c) 2006 Michel Pfeiffer and others virtual_worlds@gmx.de

See LICENSE for details.

Table of Contents

1. Overview

The Portable SDK for UPnP™ Devices is an SDK for development of UPnP device and control point applications. It consists of the core UPnP protocols along with a UPnP-specific eXtensible Markup Language (XML) parser supporting the Document Object Model (DOM) Level 2 API and an optional, integrated mini web server for serving UPnP related documents. It provides developers with an API and open source code for building control points, devices, and bridges that are compliant with Version 1.0 of the Universal Plug and Play Device Architecture Specification and supports several operating systems like Linux, *BSD, Solaris and others.

2. General Information

UPnP™ is an architecture that enables discovery, event notification, and control of devices on a network, independent of operating system, programming language, or physical network connection.  UPnP™ is based on common Internet standards and specifications such as TCP/IP, HTTP, and XML. For detailed information about UPnP™, including the UPnP™ Device Architecture Specification, please visit the UPnP™ Forum web site.

In 2000, Intel created the first version of the Linux SDK for UPnP™ Devices and subsequently released it to the open source community to foster growth of UPnP™.  To learn more about  Intel's involvement with both UPnP™ and the SDK, please visit Intel's Universal Plug and Play web site.

In 2006 this 100% compatible fork of the original project was created to support further development. This way, the project now continues using the name "Portable UPnP™" and as a project that is more open to contributions of the community. The main goal is the availability of the project for all important platforms to become a standard for UPnP™.

3. Changelog

4. Documentation

The documentation resides inside the source code itself and is generated by Doxygen. Documentation for each function resides in a comment section immediately preceding the function.

With Doxygen installed, build the docs from your build directory:

cmake --build . --target docs   # generates HTML under docs/doxygen/html/index.html

Note: the UPnP_Programming_Guide.pdf included in the docs/ directory is from version 1.2 and is outdated.

4.1. Quick Start

For a minimal, standalone example of how to use libupnp with CMake — independent of the repository's own build system — see the community-maintained libupnp_example project. It demonstrates a simple SSDP client and shows how to write a CMakeLists.txt that uses find_package(upnp) to link against an installed copy of the library. It has been tested on Linux and Windows.

For a fuller reference covering a complete UPnP device and control point, see the samples/tv directory in this repository.

5. Other projects that are using the SDK

This is a list of some of the projects and products that are based on the SDK for UPnP™ Devices.  Please let us know if you are working on a project and would like to see it listed here!

The links listed here point to external pages that are not under our control, that means we do not have any influence on their contents. Some jurisdictions have the point of view that the owner of a internet page is responsible for links to other webpages and the contents that can be found there. (Landgericht Hamburg, Judgement from 12th May 1998, 312 O 85/98).

Because of that, the operator of these pages is dissociating explicitly from all links made from here. If we are informed about pages with penal relevant names, links, contents or something else we'll remove links to these pages immediately in case that is technically possible and reasonable.

6. License Conditions

The Portable SDK for UPnP™ Devices is distributed under the BSD (Berkeley Standard Distribution) license. This license allows you to use the source code royalty free and does not place any restrictions on what you do with source code derived from the SDK. For full details on the license conditions, please consult the LICENSE file located inside the SDK distribution.

7. Release List

Release NumberDateHistory
2.0.22026-06-17Portable UPnP SDK
2.0.12026-06-17Portable UPnP SDK
2.0.02026-06-16Portable UPnP SDK
1.18.52026-04-22Portable UPnP SDK
1.18.42026-03-27Portable UPnP SDK
1.18.32026-03-16Portable UPnP SDK
1.18.22026-03-10Portable UPnP SDK
1.18.12026-03-01Portable UPnP SDK
1.18.02026-02-09Portable UPnP SDK
1.16.0canceledPortable UPnP SDK
1.14.312026-04-22Portable UPnP SDK
1.14.302026-02-09Portable UPnP SDK
1.14.292026-02-08Portable UPnP SDK
1.14.282026-02-08Portable UPnP SDK
1.14.272026-02-08Portable UPnP SDK
1.14.262026-02-06Portable UPnP SDK
1.14.252025-09-18Portable UPnP SDK
1.14.242025-06-11Portable UPnP SDK
1.14.232025-06-07Portable UPnP SDK
1.14.222025-06-02Portable UPnP SDK
1.14.212025-06-01Portable UPnP SDK
1.14.202024-10-07Portable UPnP SDK
1.14.192024-04-22Portable UPnP SDK
1.14.182023-08-21Portable UPnP SDK
1.14.172023-04-30Portable UPnP SDK
1.14.162023-03-30Portable UPnP SDK
1.14.152022-11-18Portable UPnP SDK
1.14.142022-10-05Portable UPnP SDK
1.14.132022-08-03Portable UPnP SDK
1.14.122021-09-26Portable UPnP SDK
1.14.112021-08-20Portable UPnP SDK
1.14.102021-08-17Portable UPnP SDK
1.14.92021-08-08Portable UPnP SDK
1.14.82021-08-07Portable UPnP SDK
1.14.72021-05-08Portable UPnP SDK
1.14.62021-04-19Portable UPnP SDK
1.14.52021-04-06Portable UPnP SDK
1.14.42021-03-29Portable UPnP SDK
1.14.32021-03-29Portable UPnP SDK
1.14.22021-02-28Portable UPnP SDK
1.14.12021-02-08Portable UPnP SDK
1.14.02020-07-20Portable UPnP SDK
1.12.12020-04-07Portable UPnP SDK
1.12.02020-01-22Portable UPnP SDK
1.10.12019-11-20Portable UPnP SDK
1.10.02019-11-01Portable UPnP SDK
1.8.72020-04-07Portable UPnP SDK
1.8.62019-11-20Portable UPnP SDK
1.8.52019-11-01Portable UPnP SDK
1.8.42018-10-25Portable UPnP SDK
1.8.32017-11-12Portable UPnP SDK
1.8.22017-11-12Portable UPnP SDK
1.8.12017-05-24Portable UPnP SDK
1.8.02017-01-04Portable UPnP SDK
1.6.252016-02-10Portable UPnP SDK
1.6.242017-11-19Portable UPnP SDK
1.6.232017-11-19Portable UPnP SDK
1.6.222017-05-30Portable UPnP SDK
1.6.212016-12-21Portable UPnP SDK
1.6.202016-07-07Portable UPnP SDK
1.6.192013-11-15Portable UPnP SDK
1.6.182013-01-29Portable UPnP SDK
1.6.172012-04-03Portable UPnP SDK
1.6.162012-03-21Portable UPnP SDK
1.6.152012-01-25Portable UPnP SDK
1.6.142011-11-17Portable UPnP SDK
1.6.132011-03-17Portable UPnP SDK
1.6.122011-02-08Portable UPnP SDK
1.6.112011-02-07Portable UPnP SDK
1.6.102011-01-30Portable UPnP SDK
1.6.92010-11-07Portable UPnP SDK
1.6.82010-10-21Portable UPnP SDK
1.6.72010-10-04Portable UPnP SDK
1.6.62008-04-25Portable UPnP SDK
1.6.52008-02-02Portable UPnP SDK
1.6.42008-01-26Portable UPnP SDK
1.6.32007-12-26Portable UPnP SDK
1.6.22007-12-10Portable UPnP SDK
1.6.12007-11-08Portable UPnP SDK
1.6.02007-06-23Portable UPnP SDK
1.4.62007-04-30Portable UPnP SDK
1.4.52007-04-28Portable UPnP SDK
1.4.42007-04-17Portable UPnP SDK
1.4.32007-03-06Portable UPnP SDK
1.4.22007-02-16Portable UPnP SDK
1.4.12006-08-11Portable UPnP SDK
1.4.02006-06-12Portable UPnP SDK
1.3.12006-03-05UPnP SDK for Linux
1.3.02006-03-04UPnP SDK for Linux
1.2.1a2003-11-08UPnP SDK for Linux
1.2.12003-02-13UPnP SDK for Linux
1.0.42001-08-15UPnP SDK for Linux
1.0.32001-06-12UPnP SDK for Linux
1.0.22001-02-07UPnP SDK for Linux
1.0.12000-10-13UPnP SDK for Linux
1.0.02000-08-31UPnP SDK for Linux
0.9.12000-08-17UPnP SDK for Linux
0.9.02000-08-01UPnP SDK for Linux

8. Package Contents

The SDK for UPnP Devices contains the following:

Path/FileDescription
READMEThis file. Contains the installation and build instructions.
LICENSEThe licensing terms the SDK is distributed under.
NEWSChanges and new features.
ixml/docThe files for generating the XML parser documentation from the source code.
ixml/incThe public include files required to use the XML parser.
ixml/srcThe source code to the XML parser library.
upnp/docThe files for generating the SDK documentation from the source code.
upnp/incThe public include files required to use the SDK.
upnp/srcThe source files comprising the SDK, libupnp.so.
samples/tvA sample device and control point application, illustrating the usage of the SDK.

9. System Requirements

The SDK for UPnP Devices is designed to compile and run under several operating systems. It does, however, have dependencies on some packages that may not be installed by default. All packages that it requires are listed below.

DependencyDescription
libpthreadThe header and library are installed as part of the glibc-devel package (or equivalent).

Additionally, the documentation for the SDK can be auto-generated from the upnp.h header file using Doxygen, a documentation system for C, C++, IDL, and Java*. Doxygen generates the documentation in HTML or TeX format. Using some additional tools, the TeX output can be converted into a PDF file. To generate the documentation these tools are required:

PackageDescription
DoxygenThe homepage for Doxygen is https://www.doxygen.nl/index.html. The current version as of this release of the SDK is version 3.4.9. Doxygen is the only requirement for generating the HTML documentation.
LaTeX/TeXTo generate the PDF documentation, LaTeX and TeX tools are necessary. The tetex and tetex-latex packages provide these tools.
dvipsdvips converts the DVI file produced by LaTeX into a PostScript* file. The tetex-dvips package provides this tool.
ps2pdfThe final step to making the PDF is converting the PostStript* into Portable Document Format. The ghostscript package provides this tool.

For the UPnP library to function correctly, networking must be configured properly for multicasting. To do this:

% route add -net 239.0.0.0 netmask 255.0.0.0 eth0

where 'eth0' is the network adapter that the UPnP library will use. Without this addition, device advertisements and control point searches will not function.

10. Build Instructions

10.1. Pre-requisites

Some packages/tools are required to build the library. Here's a minimal 'inspirational example' that builds the library using a Docker Ubuntu image.

% docker run -it --rm ubuntu /bin/bash

% apt update \
  && apt install -y build-essential cmake pkg-config git \
  && git clone http://github.com/pupnp/pupnp.git \
  && cd pupnp \
  && cmake -B build

% cmake --build build

10.2. CMake Build

In Order to build everything using the cmake build system, you just need to install cmake for your platform. Standalone cmake is recommended, IDE's like Visual Studio have built-in support which works, but as cmake in general encourages out-of-source builds and VS writes it's config into the source, cmake-gui should be used on windows.

All known options have the same meaning as stated in point 10.2. In Addition 2 options have been added.

  • DOWNLOAD_AND_BUILD_DEPS: This option is only available if a useable git program was found on your system. With this option on, the pthread4w package will be downloaded while configuring the build-env, then it will be build and installed along with upnp.

  • BUILD_TESTING: This option activates the tests.

If you don't want to build pthreads4w in the same build as upnp, you can download it from https://github.com/Vollstrecker/pthreads4w. Just build and install it. The libs and headers will be found, if you set CMAKE_INSTALL_PREFIX (the base install dir) to the same location.

For information on general usage of the cmake build system see: https://cmake.org/cmake/help/v3.19/guide/user-interaction/index.html

11. Install/Uninstall Instructions

11.1. Install

The top-level makefile for the UPnP SDK contains rules to install the necessary components. To install the SDK, as root:

% make install

11.2. Uninstall

Likewise, the top-level makefile contains an uninstall rule, reversing the steps in the install:

% make uninstall

12. Product Release Notes

The SDK for UPnP Devices v1.2.1a has these known issues:

  • The UPnP library may not work with older versions of gcc and libstdc++, causing a segmentation fault when the library loads. It is recommended that gcc version 2.9 or later be used in building library.
  • The UPnP library does not work the glibc 2.1.92-14 that ships with Red Hat 7.0. For the library to function, you must updated the glibc and glibc-devel packages to 2.1.94-3 or later. There is some issue with libpthreads that has been resolved in the 2.1.94 version.

13. New Features

See ChangeLog file.

14. Support and Contact Information

Intel is not providing support for the SDK for UPnP Devices. Mailing lists and discussion boards can be found at https://github.com/pupnp/pupnp/discussions.

If you find this SDK useful, please send an email to upnp@intel.com and let us know.

* Other brands, names, and trademarks are the property of their respective owners.

15. IXML support for scripting languages

The tree structure of XML documents created by IXML is hard to maintain when creating a binding for a scripting language. Even when many elements may never be used on the script side, it requires copying the entire tree structure once you start accessing elements several levels deep.Hence scriptsupport was added. To enable it compile while IXML_HAVE_SCRIPTSUPPORT has been defined (enabled by default). This allows control using only a list instead of a tree-like structure, and only nodes actually accessed need to be created instead of all the nodes in the tree.

Here's how its supposed to work:

  • The scriptsupport allows you to add a callback when a node is freed on the C side, so appropriate action can be taken on the script side, see function ixmlSetBeforeFree().
  • Instead of recreating the tree structure, an intermediate object should be created only for the nodes actually accessed. The object should be containing a pointer to the node and a 'valid flag' which is initially set to TRUE (the valid flag, can simply be the pointer to the node being NULL or not). Before creating the intermediate object, the custom tag 'ctag' can be used to check whether one was already created.
  • the node object gets an extra 'void* ctag' field, a custom tag to make a cross reference to the script side intermediate object. It can be set using ixmlNode_setCTag(), and read using ixmlNode_getCTag(). Whenever a new intermediate object is created, the ctag of the corresponding node should be set to point to this intermediate object.
  • The tree structure traversal is done on the C side (looking up parents, children and siblings)
  • Every intermediate object created should be kept in a list (preferably a key-value list, where the key is the pointer to the node and the value is the pointer to the intermediate object)
  • when the callback is called, the node should be looked up in the list, the flag set to false, the pointer to the C-side node be cleared and on the C-side the ctag should be cleared.
  • whenever the intermediate object is accessed and its flag is set to False, an error should be thrown that the XML document has been closed.

Freeing resources can be done in 2 ways, C side by simply calling the free node methods, or script side by the garbage collector of the script engine.

Script side steps:

  • if the valid flag is set to False (XML document is closed), then the intermediate object can be destroyed, no further action.
  • if the node has a parent, then the intermediate object can be destroyed after the ctag on the corresponding node has been cleared. Nothing needs to be freed on the C-side.
  • if the node has no parent, then the node must be freed on the C side by calling the corresponding free node methods. This will result in a chain of callbacks closing the node and all underlying nodes.

16. SourceForge Badges

oss-users-love-us oss-community-choice oss-sf-favorite oss-community-leader oss-open-source-excellence

Download Portable UPnP SDK Download Portable UPnP SDK Download Portable UPnP SDK Download Portable UPnP SDK

17. Thanks

  • To all the people listed in the THANKS file.
  • To JetBrains for kindly providing us with open source licenses of their amazing products.

JetBrains Logo

Similar Projects

Discover other similar projects and AI models.

RepositoryC
curl/curl

A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET, TFTP, WS and WSS. libcurl offers a myriad of powerful features

43.7k
Nov 28, 2026
RepositoryC
philippe44/AirConnect

Use AirPlay to stream to UPnP/Sonos & Chromecast devices

4.3k
Nov 8, 2026
RepositoryC++
webview/webview

Tiny cross-platform webview library for C/C++. Uses WebKit (GTK/Cocoa) and Edge WebView2 (Windows).

14.4k
Oct 22, 2026
RepositoryC++
realsenseai/librealsense

RealSense SDK

9.1k
Dec 1, 2026
RepositoryJava
UniversalMediaServer/UniversalMediaServer

A DLNA, UPnP and HTTP(S) Media Server.

2.7k
Nov 26, 2026
RepositoryGo
alexballas/go2tv

Cast media files to Smart TVs and Chromecast devices.

1.2k
Nov 28, 2026
RepositoryGo
anacrolix/dms

A UPnP DLNA Digital Media Server that includes basic video transcoding. Tested on a Panasonic Viera television, several Android UPnP apps, and Chromecast.

756
Nov 29, 2026
RepositoryRust
dheijl/swyh-rs

Stream What You Hear written in rust, inspired by SWYH.

614
Nov 26, 2026
RepositoryPython
gabrielmagno/nano-dlna

A minimal UPnP/DLNA media streamer

200
Aug 28, 2023