summaryrefslogtreecommitdiff
path: root/libdleyna
Commit message (Collapse)AuthorAgeFilesLines
* Port to gupnp-1.2Jan Tojnar2019-03-161-2/+2
| | | | | | | gupnp_context_get_host_ip has been deprecated for a long time, as the host-ip property moved to gssdp. There is also a ton of new deprecations but I will address that separately.
* Changed the Copyright to 2017Rick Bell2017-02-2725-25/+25
|
* Include libgupnp/gupnp-context-manager.hDominique Leuenberger2016-11-141-0/+1
| | | | | | As we make use of the type 'GUPnPContextManager' we need to ensure that this is known here. Relying on any other random header to being this in for us is unreliable (and has been seen failing in the wild).
* fix for issues #154 and #155ljsachs-patch-2ljsachs2016-10-111-3/+3
|
* fix for issue #156ljsachs2016-10-111-2/+2
|
* Fix possible use-after-free on exitBastien Nocera2015-12-092-1/+7
| | | | | | | | | | When the last client of dleyna-server exits, and dleyna-server tries to exit, it might use the "upnp" pointer after it was freed as we receive a signal where the user_data is invalid. Avoid that by zero'ing freed pointers and disconnecting from the signal for which "upnp" is user_data. See https://retrace.fedoraproject.org/faf/reports/855440/
* Merge branch 'master' of https://github.com/01org/dleyna-serverLarry Sachs2015-06-092-0/+35
|\
| * Add Artist and AlbumArtURL to MediaContainer2Rick Bell2015-05-082-0/+35
| |
* | ifaddrs.h for Andriod compileLarry Sachs2015-06-092-0/+38
|/
* Added new core.c and core.h to Makefile.am.Rick Bell2015-05-0120-27/+30
| | | | Updated Copyright from 2013 to 2015
* [Props] Fix ChildCount property typeJussi Kukkonen2015-02-241-1/+1
| | | | | | It's a uint32, not a signed int. Fixes #145.
* [Autoconf] Sub Makefile: Remove ACLOCAL_AMFLAGSLudovic Ferrandis2014-07-081-2/+0
| | | | | | | | | | | According to Automake.pdf: ACLOCAL_AMFLAGS: This variable is only useful in the top-level ‘Makefile.am’. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com> Fixes #127. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
* [upnp] Use "port" setting when creating GUPnPContextManagerJussi Kukkonen2014-07-084-1/+6
| | | | | | Fixes #140. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
* [Deprecated API] Use new API instead of deprecatedLudovic Ferrandis2014-07-081-2/+2
| | | | | | | | Use instead gssdp_client_get_host_ip of gupnp_context_get_host_ip Fix issue #104: <https://github.com/01org/dleyna-server/issues/104> Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Device] Fix wake-on ip address used for broadcastChristophe Guiraud2013-12-121-0/+88
| | | | | | | | | When the wake-on method is UDP broadcast, we now use the broadcast IP address of the active context newtork interface. if the broadcast IP address can't be retrieved, we use the IP address provided in the network interface info. Signed-off-by: Christophe Guiraud <christophe.guiraud@intel.com>
* [Device] Sleeping devices cache cleanupChristophe Guiraud2013-12-126-2/+90
| | | | | | | | | | | | | When a sleeping device is removed from the network we persist it in our memory cache device->sleeping_context to keep possible the call of its wake method. This patch delete a sleeping device persisted in memory cache if after we call its wake method (successfully or not) we have not received any alive sign from the device for a timeout based on the device LPE estimated wake-on delay if it can be retrieved or a default one (30 seconds) if none is provided. Signed-off-by: Christophe Guiraud <christophe.guiraud@intel.com>
* [Device] Improve sleeping context lookupChristophe Guiraud2013-12-121-9/+11
| | | | | | | | - Add missing context Ip address idx initialization. - Use UDP-Broadcast as default wake transport if none is provided in the network interface info data. Signed-off-by: Christophe Guiraud <christophe.guiraud@intel.com>
* [Device] Move the network interface info storageChristophe Guiraud2013-12-122-9/+7
| | | | | | | | | | | The network interface info which is used for the device wake-on is now stored in the dls_device_t structure instead of the dls_device_context_t structure. This makes more sense since we only store the one network interface info element (the best matching) whatever the device context count of a device. Signed-off-by: Christophe Guiraud <christophe.guiraud@intel.com>
* [Device] Improve Network Interface info and device context matchingChristophe Guiraud2013-12-122-68/+95
| | | | | | | | | | | | | | - The matching of the Network Interface information with the device context was previously based on both the IP address and the device UUID. In the case where no matching is found with this method, another try is done by just using the device UUID match. - Optimize the lookup by only adding to the network info list the element matching the device UUID. - The device context Network interface info IP address is used for the wake-on packet sending. - Fix UDP error initialization. Signed-off-by: Christophe Guiraud <christophe.guiraud@intel.com>
* [Device] Retrieve sleeping state via GetInterfaceInfo actionChristophe Guiraud2013-12-125-32/+283
| | | | | | | | | Some devices may continue to send SSDP messages even if they are asleep. Thus we cannot assume that a device is awake just because we can discover it. If a device is dicovered we need to retrieve it's sleeping state via the UPnP GetInterfaceInfo action. Signed-off-by: Christophe Guiraud <christophe.guiraud@intel.com>
* [Device] Add sleeping device memory cacheChristophe Guiraud2013-12-127-34/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | when the last context of a sleeping device is notified as unavailable, instead of having the device and its context deleted, the device is kept alive, the lost server notification is not broadcasted, the device is moved from the "device_udn_map" to a "sleeping device udn" map and the context is stored in a new device structure context field "sleeping_device_context". All pending operations related to the device will also be cancelled. The GetServer() request returns now the devices available in the "sleeping device udn" map in addition to those in the "device udn map". when a get_prop request is done on a device with a sleeping_device_context available this one is used to perform the request. all Dbus requests other than "get_prop" and "wake" invoked on a device with a sleeping_device_context available fail with an error "DLEYNA_ERROR_OPERATION_FAILED". when a new device proxy is notified as available, if it belongs to the "sleeping device udn" map, then it is removed from the "sleeping device udn" map and detroyed, the lost server notification is then broadcasted. The new proxy device is then constructed as usual. Signed-off-by: Christophe Guiraud <christophe.guiraud@intel.com>
* [Device] Add wake packet sending supportChristophe Guiraud2013-12-121-9/+324
| | | | | | | | | | | | | | | - Add the wake method implementation A bytes buffer is computed from the wake on pattern hex string. The buffer is sent according to the device wake transport method. Wake transport methods TCP/UDP unicast and UDP broadcast are supported. If the device is not sleeping, the function returns with no error. The TCP data sending is implemented with GSocketClient. It is done asynchronously and so can be cancelled. UDP data sending uses GSocket. The default wake packet port 9 is used. Signed-off-by: Christophe Guiraud <christophe.guiraud@intel.com>
* [Device] Add Energy Management featuresChristophe Guiraud2013-12-1213-222/+991
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a Wake method to DBus MediaDevice interface, this method can be invoked to wake-up a sleeping device by sending the appropriate WOL magic packet. Information to be used for the magic packet formatting will be retrieved from the device context. - Add a DLS_INTERFACE_PROP_SLEEPING boolean property to DBus MediaDevice interface, this property reflects the sleeping state of the MediaServer. The property is not present if the Energy Management service isn't supported by the device embedding the MediaServer. The DLS_INTERFACE_PROP_SLEEPING property is updated based on the EM service NetworkInterfaceInfo evented state variable. The DLS_INTERFACE_PROP_SLEEPING property is set to FALSE by default at the device construction. NetworkInterfaceInfo information are XML encoded, relevant information are parsed with the help of libxml2. dleyna-server has now a direct dependency on libxml2. a new xml-util.c file with its header provides libxml2 helpers. XML extracted information are stored into the matching device context. The matching device context is selected based on the interface ip address and the device uuid. A device is considered as in sleeping state if its network interface is up. - Add a DLS_INTERFACE_PROP_ROOT_UDN string property, if present this property contains the UDN of the root device embedding a MediaServer sub-device. - Update the device contruction to allow the usage of a MediaServer even if it is sub-device, in the same as way if it was the root device from the application layer perpective. We ask now to be notified for all upnp:rootdevice and we filter those who are MediaServer or have a sub device of this type. (recursive lookup in the device child hierarchy if any). Only the first MediaServer device found will be considered. we also retrieve the Energy Management service proxy from the root device if it is available and else we use the first one that we found by doing a recursive lookup in the device child hierarchy. we use it to be notified of its NetworkInterfaceInfo evented state variable changes. - As we have now to handle multiple device proxies (CDS, EMS), we use now a struct dls_service_t to gather cds and ems services related information (GUPnPServiceProxy *proxy, gboolean subscribed, guint timeout_id) in the device context. - Add the Wake Method to the python test application. - Documentation updated. Signed-off-by: Christophe Guiraud <christophe.guiraud@intel.com>
* [Server] cosmeticsChristophe Guiraud2013-12-121-11/+13
| | | | | | - Some identation fixes Signed-off-by: Christophe Guiraud <christophe.guiraud@intel.com>
* [Configuration] Remove libdleyna-server .pc fileLudovic Ferrandis2013-12-122-19/+5
| | | | | | Fix issue #113: <https://github.com/01org/dleyna-server/issues/113> Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Property] Add 'Never Quit' property to ManagerLudovic Ferrandis2013-10-024-3/+46
| | | | | | | It is now possible to manage the 'Never Quit' option via the Set() methode. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Network Filtering] New API and saveLudovic Ferrandis2013-10-028-234/+259
| | | | | | | | - Remove all WhiteListxxx API - Add Set() to 'org.freedesktop.DBus.Properties' interface to 'com.intel.dLeynaServer.Manager' root interface Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Error] Get better error message for BrowseObjectsLudovic Ferrandis2013-09-261-1/+6
| | | | | | Fix #123: <https://github.com/01org/dleyna-server/issues/123> Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [BrowseObject]: Support Of ChildCount propertyLudovic Ferrandis2013-09-262-21/+195
| | | | | | Fix issue #122: <https://github.com/01org/dleyna-server/issues/122> Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Tasks] Fix a memory leakRegis Merlino2013-09-191-3/+8
| | | | | | Fixes https://github.com/01org/dleyna-collabora-android/issues/58 Signed-off-by: Regis Merlino <regis.merlino@intel.com>
* [Coding Convention] New version of CheckPatch [3.8.0.30]Ludovic Ferrandis2013-09-112-2/+2
| | | | Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Control Point] Get control point versionRegis Merlino2013-09-111-1/+7
| | | | Signed-off-by: Regis Merlino <regis.merlino@intel.com>
* [Device] Deprecate LastChange in favor of Changed signalRegis Merlino2013-09-064-16/+153
| | | | | | | | | | | Fix issue #109 * Remove LastChange signal * Add Changed signal * A Changed signal is emitted along with a ContainerUpdateID signal when LastChange is not managed by the DLNA server. Signed-off-by: Regis Merlino <regis.merlino@intel.com>
* [API] Add new BrowseObjects APILudovic Ferrandis2013-09-0410-0/+387
| | | | | | | | Add new BrowseObjects API in MediaDevice interface Fix issue #114: <https://github.com/01org/dleyna-server/issues/114> Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Filtering] Use generic filtering for GetAllLudovic Ferrandis2013-09-022-5/+5
| | | | | | | | | | | | | Task GetAll has a field member 'filter_mask'. This task and field are used by other methods, but not by GetAll properties. GetAll parsing function used directly DLS_UPNP_MASK_ALL_PROPS constant in the code. This will prevent to reuse the GetAll parsing function with another filter mask. Initialize filter_mask to DLS_UPNP_MASK_ALL_PROPS in GetAll method and use filter_mask in the GetAll parsing function. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Property] Support for new "Error" propertyLudovic Ferrandis2013-09-023-0/+33
| | | | | | | | | Add a new 'Error' property, used by BrowseObjects for instance. Error is a dictionary with 2 entries: ID: u -> Numeric error code Message: s -> Error message Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Property] Don't return empty properties in GetAllLudovic Ferrandis2013-08-291-13/+30
| | | | | | Remove various empty properties from Item and Container. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Release] Version 0.2.1v0.2.1Regis Merlino2013-08-221-1/+1
| | | | Signed-off-by: Regis Merlino <regis.merlino@intel.com>
* [Network Filtering] Add Network Filtering supportLudovic Ferrandis2013-08-2213-58/+709
| | | | | | | | | | | | | | | | | Add 2 new settings: 1 - netf_enabled (boolean): To activate or deactivate the network filtering 2 - netf_entries (str list): List of supported network Add org.freedesktop.DBus.Properties DBUS Interface to com.intel.dLeynaServer.Manager root object. Add 4 new methodes to com.intel.dLeynaServer.Manager interface 1 - WhiteListEnable 2 - WhiteListAddEntries 3 - WhiteListRemoveEntries 4 - WhiteListClear Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Build] Ship the internal library in a private directoryEmanuele Aina2013-08-082-2/+2
| | | | | | | | | | The libdleyna-server-1.0.so library is not really meant for public consumption and it's just an internal implementation detail. To prevent any confusion, ship it in a package-specific subdirectory of the configured libdir. Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
* [Server] Update following the publish_object() connector API changeRegis Merlino2013-07-231-5/+5
| | | | Signed-off-by: Regis Merlino <regis.merlino@intel.com>
* [Cleanup] Code cleanup after code reviewLudovic Ferrandis2013-07-172-30/+28
| | | | | | | | | | | | | | | - Don't initialize result in task creation. Avoid specific cases. It doesn't make the code more readable, nor smaller. - if/else cleaning. Make default action in if statement, and error management in else statement. Most common usage. - Factorize code. Move same function call from each switch/case, outside the switch. Reduce code. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Klockwork] NULL pointer may be dereferenced. (#27)Ludovic Ferrandis2013-07-011-2/+3
| | | | | | Fix issue #27: ip_address may be NULL and may be dereferenced. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Klockwork] NULL pointer may be dereferenced. (#26)Ludovic Ferrandis2013-07-011-2/+3
| | | | | | Fix issue #26: ip_address may be NULL and may be dereferenced. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* [Klockwork] NULL pointer may be dereferenced. (#3)Ludovic Ferrandis2013-07-011-1/+1
| | | | | | Fix issue #3: device_type may be NULL and may be dereferenced. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
* Added the new TypeEx property and fixed TypeMark Ryan2013-06-246-146/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Type property is now almost consistent with the MediaServer2Spec Type property. This should remove a source of constant confusion and fix a number of bugs, in for example the download sync controller. dLeyna-server's implementation of Type differs only from MediaServer2Spec in one way. dLeyna-server has introduced one new value, item.unclassified, which is used when the object in question is an item but not one of the items supported by MediaServer2Spec, i.e., not an audio, video or image item. A new property, TypeEx has been introduced. TypeEx contains the extended type information for an object, i.e., the value Type used to hold (althought the values have changed), so if applications want the extended type they can still retrieve it. Both Type and TypeEx are searchable. The superset of values specified by TypeEx are permitted when creating a container, both in the type of the container and it its create classes. The extended type is exposed in the CreateClasses of a container and in the LastChange event. Type is no longer permitted in Update. TypeEx must be used. From an API point of view there are two breakagaes: 1. Applications that used Type to retrieve extended type information, need to be updated to use TypeEx. Applications that used Type in their search queries might also need to be updated. 2. Applications that updated the Type of an object will need to be updated to use TypeEx instead. There is one slightly unpleasent hack required to report the correct values for Search and Sort Caps. A correct solution would require making the p_map hash table many to many, which would result in a bigger change. I've left this improvement for another commit. Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
* [Server] Fix a crash case when the server stopsRegis Merlino2013-06-071-3/+4
| | | | Signed-off-by: Regis Merlino <regis.merlino@intel.com>
* [Configuration] Post-release version bumpRegis Merlino2013-05-311-1/+1
| | | | Signed-off-by: Regis Merlino <regis.merlino@intel.com>
* [Device] Add a GetIcon() methodRegis Merlino2013-05-318-1/+230
| | | | Signed-off-by: Regis Merlino <regis.merlino@intel.com>
* [Bug Fix] Use object and parent id values for detecting root objectChristophe Guiraud2013-05-162-18/+50
| | | | | | | | | | | | | | | | | | | | | | | | | Change the way to identify root object. We now use both object and parent ids values. Object with a "0" object id value or a "-1" parent id value will be considered as root object. Reasons for accepting both: a) there's code out there where root parent_id != -1 and b) there's also code out there where root-like (parentless) objects id != 0. Object with a "0" id value or a "-1" parent id value This fixes the case of issue #32 where root have an empty string as parent id value. According to the specification root parent id must have a "-1" value. Fix issue: https://github.com/01org/dleyna-server/issues/32 Signed-off-by: Christophe Guiraud <christophe.guiraud@intel.com>