Skip to content
View upnplib's full-sized avatar

Block or report upnplib

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
upnplib/README.md

The UPnP Library

Under developement! Not usable at time. README.md only as draft, work in progress.

1. Overview

This is a fork of the Portable SDK for UPnP Devices (pupnp) with the aim of a complete re-engeneering based on UPnP™ Device Architecture 2.0. The following general goals are in progress or planned:

  • Drop in compatibillity with the old pUPnP library
  • Continue optimization for embedded devices
  • Based on C++ instead of C
  • Object oriented programming
  • Unit-Test driven developement
  • Using CMake for managing the code
  • Focus on IPv6 support

2. Technical Documentation

Here you can find the Technical Documentation.\n If you want to be compatible with the classic pUPnP library here you find the [Compatible API](\ref compaAPI).\n To use the new written object oriented part of the library here you find its [UPnPlib API](\ref upnplibAPI).

3. Version numbering

We follow the Semantic Versioning. In short it defines

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add or modify functionality in a backwards compatible manner, and
  • PATCH version when you make backwards compatible bug fixes.

The UPnpLib version starts with 0.1.0. Major version 0 means it's not a productive version but under developement. Because we will use CMake to manage the code it can be seen as integral part of the project. The UPnPlib version number will also reflect changes to the CMake configuration.

This fork is based on release-1.14.19 of the pupnp library.

4. Milestones

  • Ongoing: create extensive Unit Tests without modification of the old source code
  • Ongoing: define C++ interfaces for the API
  • Ongoing: change old C program to C++ objects but preserve drop in compatibility
  • Ongoing: support IP6
  • Ongoing: support OpenSSL

5. Build Instructions

If nothing others said we are always staying at the root directory of the project (CMAKE_SOURCE_DIR), that is upnplib_project/ if you don't changed the name.

5.1. Linux and MacOS build

First configure then build:

upnplib_project$ cmake -S . -B build -D UPNPLIB_WITH_SAMPLES=YES
upnplib_project$ cmake --build build

To clean up a build just delete the build folder:

upnplib_project$ rm -rf build

5.2. Microsoft Windows build

The developement of this UPnP Library has started on Linux. So for historical reasons it uses POSIX threads (pthreads) as specified by The Open Group. Unfortunately Microsoft Windows does not support it so I have to use a third party library. I use the well known and well supported pthreads4w library. It will be downloaded on Microsoft Windows and compiled with building the project and should do out of the box. To build the UPnPlib you need a Developer Command Prompt. How to install it is out of scope of this description. Microsoft has good documentation about it. For example this is the prompt I used:

**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.9.5
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

ingo@WIN10-DEVEL C:\Users\ingo> pwsh
PowerShell 7.4.1
PS C:\Users\ingo>

First configure then build:

PS C: upnplib_project> cmake -S . -B build -D UPNPLIB_WITH_SAMPLES=YES
PS C: upnplib_project> cmake --build build --config Release

After build don't forget to copy the needed ./build/_deps/pthreads4w-build/pthread*.dll library file to a location where your program can find it. Copying it to your programs directory or to the system directory Windows\System32 will always do. Within the project developement directory tree (default root upnplib_project/) built programs and libraries find its dll files. There is nothing to do.

To clean up a build just delete the build folder:

PS C: upnplib_project> rm -rf build

If you need more details about installation of POSIX threads on Microsoft Windows I have made an example at github pthreadsWinLin.

5.3 Googletest build

I strongly recommend to use shared gtest libraries for this project because there are situations where static and shared libraries are linked together. Using static linked Googletest libraries may fail then. If you know what you ar doing and you are able to manage possible linker errors you can try to use static built Googletest libraries.

# strongly recommended shared libs
upnplib_project$ cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -D UPNPLIB_WITH_GOOGLETEST=ON
upnplib_project$ cmake --build build --config Debug

# or alternative static libs
upnplib_project$ cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -D UPNPLIB_WITH_GOOGLETEST=ON -D GTESTS_WITH_SHARED_LIBS=OFF
upnplib_project$ cmake --build build --config Debug

Using build type "Debug" is not necessary for Googletest but it will enable additional debug messages from the library. if you don't need it you can just use "Release" instead of "Debug" above as option.

6. Limitations

No limits documented so far.


Copyright (C) 2021+ GPL 3 and higher by Ingo Höft, \
Redistribution only with this Copyright remark. Last modified: 2024-08-04

Popular repositories Loading

  1. upnplib upnplib Public

    Moved to the UPnP Software Development Kit (https://github.com/UPnPsdk). Have a look there.

    C++ 6

  2. inspect_pthreadsWinLin inspect_pthreadsWinLin Public

    Proof of concept for the main project UPnPlib to have POSIX threads on Microsoft Windows and Linux with cmake.

    C++ 2

  3. inspect_cmake_multiplatform inspect_cmake_multiplatform Public

    Testing cmake to build a library with linking another external library

    CMake 1

  4. hello hello Public

    Simple test program to verify github and cmake working.

    CMake 1

  5. inspect_FetchContent inspect_FetchContent Public

    Inspect cmake FetchContent to install a project without dependencies to the main project.

    CMake 1

  6. inspect_GoogleTest inspect_GoogleTest Public

    Inspect how GoogleTest works with cmake FetchContent.

    CMake 1