Closed
Bug 751172
Opened 12 years ago
Closed 9 years ago
[B2G] SSDP advertising Service
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: sinker, Assigned: schien)
References
Details
Attachments
(2 files, 7 obsolete files)
81 bytes,
text/html
|
Details | |
120.90 KB,
patch
|
Details | Diff | Splinter Review |
Implement SSDP service that delegates advertising and responses for discovery requests for the registered services. The function of finding services from other devices is not a part of this bug that should be in a follow-up bug.
Reporter | ||
Updated•12 years ago
|
Assignee: nobody → slee
Assignee | ||
Updated•12 years ago
|
Assignee: slee → schien
Assignee | ||
Comment 1•12 years ago
|
||
proposed interface for SSDP service, also include the device/service profile interface which required by SSDP service.
Attachment #635689 -
Flags: feedback?
Reporter | ||
Comment 2•12 years ago
|
||
Comment on attachment 635689 [details] [diff] [review] proposed SSDP service interface Review of attachment 635689 [details] [diff] [review]: ----------------------------------------------------------------- ::: netwerk/ssdp/nsISSDPService.idl @@ +1,5 @@ > +#include "nsrootidl.idl" > +#include "nsISupports.idl" > + > +[scriptable, uuid(9f0af628-6150-4ca3-863e-d0b88157f764)] > +interface nsIServiceProfile: nsISupports With an SSDP prefix? nsISSDPServiceProfile? @@ +11,5 @@ > + //TODO: action/event/state descriptor > +}; > + > +[scriptable, uuid(35511f8c-80a7-4477-add1-f563ee86c56c)] > +interface nsIDeviceProfile : nsISupports As well @@ +17,5 @@ > + attribute nsID uuid; > + attribute ACString urn; > + attribute ACString xmlDescriptor; > + > + nsIDeviceProfile getEmbeddedDevice(in nsID deviceUUID); See the comment for getServiceProfile. @@ +20,5 @@ > + > + nsIDeviceProfile getEmbeddedDevice(in nsID deviceUUID); > + void asyncAddDevice(in nsIDeviceProfile deviceProfile); > + void asyncRemoveDevice(in nsID deviceUUID); > + nsIServiceProfile getServiceProfile(in nsID serviceUUID); Async? I guess this is a small set of items. You can just provide an enumerator; for example, nsISimpleEnumerator or alike. @@ +22,5 @@ > + void asyncAddDevice(in nsIDeviceProfile deviceProfile); > + void asyncRemoveDevice(in nsID deviceUUID); > + nsIServiceProfile getServiceProfile(in nsID serviceUUID); > + void asyncAddService(in nsIServiceProfile serviceProfile); > + void asyncRemoveService(in nsID serviceUUID); Just remove the prefix |async| and return something like DOMRequest for async. For example, interface nsISSDPRequest : nsISupports { attribute nsISSDPSuccessCallback onsuccess; attribute nsISSDPErrorCallback onerror; }; @@ +37,5 @@ > + > + /** > + * host name used in SSDP advertisement > + */ > + attribute ACString hostName; Readonly? @@ +45,5 @@ > + * @param aHttpPort port number for http server > + * @param aExpiryTime SSDP advertisement expiration time > + * @param aHostName host name used in SSDP advertisement > + */ > + void init(in unsigned long aHttpPort, in unsigned long aExpiryTime, in ACString aHostName); We don't prefix argument names with |a| in IDL. But, xpidl generates header files with |a| prefixed argument names. So, we use argument names with |a| prefixed for native code. @@ +50,5 @@ > + > + /** > + * start SSDP service > + */ > + void start(); Async? @@ +55,5 @@ > + > + /** > + * stop SSDP service > + */ > + void stop(); Async? Can you restart this service? For example, stop it, and re-init it, then start it again.
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Thinker Li [:sinker] from comment #2) > Comment on attachment 635689 [details] [diff] [review] > proposed SSDP service interface > > Review of attachment 635689 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: netwerk/ssdp/nsISSDPService.idl > @@ +1,5 @@ > > +#include "nsrootidl.idl" > > +#include "nsISupports.idl" > > + > > +[scriptable, uuid(9f0af628-6150-4ca3-863e-d0b88157f764)] > > +interface nsIServiceProfile: nsISupports > > With an SSDP prefix? nsISSDPServiceProfile? > originally I try to implement SSDP as a sub-service in UPnP service, therefore, I chose a service-neutral name for ServiceProfile/DeviceProfile. I can add "SSDP" prefix to the profile type since we are going to make SSDP an independent service. I'll change the name and put the diff on bugzilla later. > @@ +11,5 @@ > > + //TODO: action/event/state descriptor > > +}; > > + > > +[scriptable, uuid(35511f8c-80a7-4477-add1-f563ee86c56c)] > > +interface nsIDeviceProfile : nsISupports > > As well > see notes for nsIServiceProfile above. > @@ +17,5 @@ > > + attribute nsID uuid; > > + attribute ACString urn; > > + attribute ACString xmlDescriptor; > > + > > + nsIDeviceProfile getEmbeddedDevice(in nsID deviceUUID); > > See the comment for getServiceProfile. > > @@ +20,5 @@ > > + > > + nsIDeviceProfile getEmbeddedDevice(in nsID deviceUUID); > > + void asyncAddDevice(in nsIDeviceProfile deviceProfile); > > + void asyncRemoveDevice(in nsID deviceUUID); > > + nsIServiceProfile getServiceProfile(in nsID serviceUUID); > > Async? I guess this is a small set of items. You can just provide an > enumerator; for example, nsISimpleEnumerator or alike. > Ok to provide enumerator interface for retrieving embedded device/service profile. BTW, I suggest to provide a snapshot on device/service profile for those service user, since it's bug-prone to allow service user seeing real-time update introduced by other thread. Does this design match the convention in mozilla? > @@ +22,5 @@ > > + void asyncAddDevice(in nsIDeviceProfile deviceProfile); > > + void asyncRemoveDevice(in nsID deviceUUID); > > + nsIServiceProfile getServiceProfile(in nsID serviceUUID); > > + void asyncAddService(in nsIServiceProfile serviceProfile); > > + void asyncRemoveService(in nsID serviceUUID); > > Just remove the prefix |async| and return something like DOMRequest for > async. > > For example, > > interface nsISSDPRequest : nsISupports > { > attribute nsISSDPSuccessCallback onsuccess; > attribute nsISSDPErrorCallback onerror; > }; > I'll add the callback interface and rename these async interface. > @@ +37,5 @@ > > + > > + /** > > + * host name used in SSDP advertisement > > + */ > > + attribute ACString hostName; > > Readonly? > yes, should make it read only and can only change via |init| function. > @@ +45,5 @@ > > + * @param aHttpPort port number for http server > > + * @param aExpiryTime SSDP advertisement expiration time > > + * @param aHostName host name used in SSDP advertisement > > + */ > > + void init(in unsigned long aHttpPort, in unsigned long aExpiryTime, in ACString aHostName); > > We don't prefix argument names with |a| in IDL. But, xpidl generates header > files with |a| prefixed argument names. So, we use argument names with |a| > prefixed for native code. > I'll remove the |a| prefix in IDL, diff will be provided later. > @@ +50,5 @@ > > + > > + /** > > + * start SSDP service > > + */ > > + void start(); > > Async? > > @@ +55,5 @@ > > + > > + /** > > + * stop SSDP service > > + */ > > + void stop(); > > Async? > > Can you restart this service? For example, stop it, and re-init it, then > start it again. Currently I implement start/stop in a synchronous way, since the procedure for start/stop is quite light-weight. I can make it async under the consideration of access service interface in multiple thread at the same time. And sure, SSDP service is designed to allow re-init and restart. Updated IDL will be put on bugzilla later.
Assignee | ||
Comment 4•12 years ago
|
||
update IDL accroding to Thinker's feedback. introduce nsISSDPServiceRequest/nsISSDPServiceCallback for async function invocation. introduce nsISSDPDeviceEnumeration/nsISSDPServiceEnumeration for retrieving embedded device/service profiles.
Attachment #635689 -
Attachment is obsolete: true
Attachment #635689 -
Flags: feedback?
Attachment #637053 -
Flags: feedback?
Reporter | ||
Comment 5•12 years ago
|
||
(In reply to Shih-Chiang Chien from comment #4) > Created attachment 637053 [details] [diff] [review] > p2 for SSDP IDL > > update IDL accroding to Thinker's feedback. introduce > nsISSDPServiceRequest/nsISSDPServiceCallback for async function invocation. > introduce nsISSDPDeviceEnumeration/nsISSDPServiceEnumeration for retrieving > embedded device/service profiles. Please upload full definition of IDL instead of the diff file aganist previous version.
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #637053 -
Attachment is obsolete: true
Attachment #638604 -
Attachment is obsolete: true
Attachment #637053 -
Flags: feedback?
Attachment #638604 -
Flags: feedback?
Reporter | ||
Comment 8•12 years ago
|
||
Comment on attachment 638618 [details] [diff] [review] full diff of SSDP IDL V2 Review of attachment 638618 [details] [diff] [review]: ----------------------------------------------------------------- ::: netwerk/ssdp/nsISSDPService.idl @@ +5,5 @@ > + > +[scriptable, uuid(3db3800c-fbb2-456e-b4a0-c48e419223b5)] > +interface nsISSDPServiceCallback: nsISupports > +{ > + void onFinish(in nsresult rv); onHandle? onFinish is weir for onError. Also, I don't know if it is feasible to pass nsresult through interface/or callback. You need a more meaningful type for errors here. @@ +11,5 @@ > + > +[scriptable, uuid(747cf538-ce98-4b61-8bf9-a38902610840)] > +interface nsISSDPServiceRequest: nsISupports > +{ > + attribute nsISSDPServiceCallback onSuccess; What is the value of rv argument for onSuccess? If it is alway 0 (or something), you should define another callback interface to avoid passing a meaningless argument. @@ +47,5 @@ > + attribute ACString urn; > + attribute ACString xmlDescriptor; > + > + nsISSDPDeviceEnumeration getEmbeddedDevices(); > + nsISSDPServiceEnumeration getServices(); I am not sure if we should also make above two functions async. Maybe we should.
Assignee | ||
Comment 9•12 years ago
|
||
separate onSuccess/onError callback async method call for retrieving device/service profile
Attachment #638618 -
Attachment is obsolete: true
Attachment #638657 -
Flags: feedback?
Assignee | ||
Comment 10•12 years ago
|
||
WIP for SSDP, including SSDP service API & profile management
Attachment #639629 -
Flags: feedback?
Assignee | ||
Comment 11•12 years ago
|
||
SSDP Service implementation, contains SSDP service operation, SSDP Profile edit/read operation. Both C++ and xpcshell testcases are provided. remain 1 todo item - response M-SEARCH request from control point.
Attachment #638657 -
Attachment is obsolete: true
Attachment #639629 -
Attachment is obsolete: true
Attachment #638657 -
Flags: feedback?
Attachment #639629 -
Flags: feedback?
Attachment #642228 -
Flags: feedback?
Assignee | ||
Updated•11 years ago
|
Attachment #642228 -
Flags: feedback?
Assignee | ||
Comment 12•11 years ago
|
||
Comment on attachment 642228 [details] [diff] [review] WIP for SSDP v1 We've already implemented SSDP on Android in http://mxr.mozilla.org/mozilla-central/source/mobile/android/modules/SimpleServiceDiscovery.jsm. Should be able to reuse it on Firefox OS.
Attachment #642228 -
Attachment is obsolete: true
No longer blocks: 914579
Assignee | ||
Comment 13•10 years ago
|
||
Implement SSDP control point and polyfill Network Service Discovery API in javascript.
Assignee | ||
Updated•10 years ago
|
Attachment #8400444 -
Attachment mime type: text/plain → text/html
Assignee | ||
Comment 14•10 years ago
|
||
I've uploaded my current work to https://github.com/schien/ssdp.js
Assignee | ||
Comment 15•10 years ago
|
||
With the WIP patch in bug 745283, this patch provides a chrome page that can scan DLNA content provider and display image/audio by integrating ssdp.js and plug.play.js. (Many thanks to @rexboy for writing the chrome page) The demo page is in chrome://global/content/player.html.
Comment 16•10 years ago
|
||
why not use the SSDP support that's already in the tree? http://mxr.mozilla.org/mozilla-central/source/mobile/android/modules/SimpleServiceDiscovery.jsm
Assignee | ||
Comment 17•10 years ago
|
||
(In reply to Brad Lassey [:blassey] (use needinfo?) from comment #16) > why not use the SSDP support that's already in the tree? > > http://mxr.mozilla.org/mozilla-central/source/mobile/android/modules/ > SimpleServiceDiscovery.jsm Hi Brad, We want to provide DLNA functionality in webapp. Per discussion in bug 914579, we don't want to implement the Discovery API. So we cannot reuse the SimpleServiceDiscovery.jsm.
Note that it might be possible to reuse the same code as in SimpleServiceDiscovery.jsm. But we would need to refactor that code so that it can run on top of the internal gecko interfaces that it's currently using (timers and sockets etc) as well as on top of standardized web APIs. I'm not sure how much work is involved in doing that though.
Comment 19•10 years ago
|
||
will this use a standard or proposed standard protocol? RFC 6763 / SMPTE 2701, etc? thanks for any info :-)
Assignee | ||
Comment 20•10 years ago
|
||
(In reply to Jason Proctor from comment #19) > will this use a standard or proposed standard protocol? RFC 6763 / SMPTE > 2701, etc? > > thanks for any info :-) No, this bug is focusing on SSDP protocol from UPnP standard but ssdp.js is opened for contributing other device discovery protocols.
Comment 21•10 years ago
|
||
The SSDP API should require a user permission (like sharing the GPS does). Because with SSDP you can make a fingerprint of a network from user A. If this fingerprint is unique and user B has the same fingerprint, he is at the same location as user A. Another issue is, that you can easily detect/track which devices the user is owning (does he have a Apple TV?).
Updated•9 years ago
|
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•