Skip to content
Snippets Groups Projects
Commit 60515d89 authored by Eden Abitbol's avatar Eden Abitbol
Browse files

upnp: support libupnp and libnatnatpmp simultaneously

Update libupnp to version 1.8.4.

For windows, the IPV6 preprocessor must be undefined. Or else
libupnp won't initialize. Added visual studio 2017 support
via one patch for windows that also combines previous windows
patches.

UPnPController: Class that the jami classes use to control the
opening and closing of ports. Every  service has it's own upnp
controller. The controller does it's actions by using the upnp
context class. Also refactored the functions used to add
mappings. Instead of using two different functions with
different types of parameters, we now use one function with
parameters that have default values. The logic stays the same
but the function call is more clear.

UPnPContext: Class that holds a (linked) list of discovered IGDs
and their corresponding protocols (which discovered them).
Whenever the controller wants to add or remove a mapping, the
context picks a valid IGD in it's list and uses the correct
protocol to complete the required action. This class also has
the ability to swap protocols for an IGD that was discovered
by more then one protocol.

UPnPProtocol: Virtual base class that defines the functions
needed by the context to use the corresponding protocol.

PUPnP: UPnPProtocol derived class that represents a upnp client
that uses the portable upnp library (libupnp). Every time the
client discovers a new IGD it uses a callback to add it to the
context's main IGD linked list. It also has an internal list of
IGDs that it discovered. Added features to this class include:
	- IGD event subscription.
	- Use UpnpInit2 function instead of deprecated UpnpInit
	  function. It's also supposed to support IPv6.

NatPmp: UPnPProtocol derived class that represents a upnp client
that uses the NAT-PMP library (libnatpmp). Unlike libupnp,
libnatpmp only supports discovering one IGD. Also uses callbacks
to add the IGD it finds to the context's main IGD class.

Also inclided debug warning prints whenever a controller opens
and closes the ports. That way we can keep track of whenever
the application opens and closes ports on the internet
gateway device.

Gitlab: #96

Change-Id: I199271edac2c6d93dc60c24e2e2aefe36de7950c
parent 3e2c8637
No related branches found
No related tags found
No related merge requests found
Showing
with 3315 additions and 1624 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment