Closed Bug 904542 Opened 11 years ago Closed 7 years ago

[meta] B2G NetworkManager: Redefine the nsINetworkInterface

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(feature-b2g:3.0?, tracking-b2g:backlog)

RESOLVED WONTFIX
feature-b2g 3.0?
tracking-b2g backlog

People

(Reporter: edgar, Unassigned)

References

Details

(Whiteboard: [grooming])

Attachments

(7 files, 2 obsolete files)

To let NetworkManager can control each network, we should have connect()/disconnect() in nsINetworkInterface. And we also put all information which is needed by other module into nsINetworkInfo. So that we could just expose nsINetworkInfo instead of whole nsINetworkInterface, because we should not expose connect() and disconnect() outside NetworkManager.

The redefined nsINetworkInterface as below:

interface nsINetworkInterface {
  readonly attribute nsINetworkInfoinfo;
  readonly attribute nsIDOMString[] hostRoutes;
  readonly attribute DOMString httpProxyHost;
  readonly attribute long httpProxyPort;
  void connect();
  void disconnect();

  attribute nsIDOMEventListener onnetworkinfochanged;
}

interface nsINetworkInfo {
  readonly attribute long type; /* WIFI/MOBILE/MMS/SUPL */
  readonly attribute long serviceId; /* Mulit-SIM */
  readonly attribute long state;
  readonly attribute DOMString name; /* Interface name */
  readonly attribute DOMString ip;
  readonly attribute DOMString netmask;
  readonly attribute DOMString broadcast;
  readonly attribute DOMString gateway;
  readonly attribute DOMString dns1;
  readonly attribute DOMString dns2;
}
Blocks: 904514
(In reply to Edgar Chen [:edgar][:echen] from comment #0)
> 
> interface nsINetworkInfo {
>   readonly attribute long type; /* WIFI/MOBILE/MMS/SUPL */
Maybe we could consider use DOMString for type. In this way, we could get some advantage as below:
1. For the network interface of RIL, we can use the type in apn setting directly. So that we don't need to have a mapping between apn type and the const, NETWORK_TYPE_*.
2. If a new network is added, we don't have to add a new const for it.

>   readonly attribute long serviceId; /* Mulit-SIM */
>   readonly attribute long state;
>   readonly attribute DOMString name; /* Interface name */
>   readonly attribute DOMString ip;
>   readonly attribute DOMString netmask;
>   readonly attribute DOMString broadcast;
>   readonly attribute DOMString gateway;
>   readonly attribute DOMString dns1;
>   readonly attribute DOMString dns2;
> }
Depends on: 908135
Attached patch WIP, Part1: Interface changes, v1 (obsolete) (deleted) — Splinter Review
About the comment #1, I will file a new bug for that, for now we still use long for network type.
Attached patch WIP, Part1: Interface changes, v2 (obsolete) (deleted) — Splinter Review
Attachment #795311 - Attachment is obsolete: true
Attached patch WIP, Part2: Mtransport, v1 (deleted) — Splinter Review
Attached patch WIP, Part 3: Gps, v1 (deleted) — Splinter Review
Attached patch WIP, Part 4: Mms, v1 (deleted) — Splinter Review
Attachment #796578 - Attachment description: WIP, Part3: Gps, v1 → WIP, Part 3: Gps, v1
Attached patch WIP, Part 5: NetworkManager, v1 (deleted) — Splinter Review
Attached patch WIP, Part 6: Ril, v1 (deleted) — Splinter Review
Attached patch WIP, Part 7: Wifi, v1 (deleted) — Splinter Review
Attachment #796576 - Attachment is obsolete: true
Comment on attachment 797020 [details] [diff] [review]
WIP, Part1: Interface changes, v3

Vincent, Vicamo, could you help to give me some feedback about the new nsINetworkInterface? Thanks.
Attachment #797020 - Flags: feedback?(vyang)
Attachment #797020 - Flags: feedback?(vchang)
Comment on attachment 797020 [details] [diff] [review]
WIP, Part1: Interface changes, v3

Review of attachment 797020 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/gonk/nsINetworkInterface.idl
@@ +112,5 @@
> +
> +  /**
> +   * This event is fired when the info of network interface is changed.
> +   */
> +  attribute nsIDOMEventListener onnetworkinfochanged;

Wifi supports http proxy for different ssid. So the proxy server ip and port may change when connect to different AP. Do we want to pass updated parameters when connection status change ?
Attachment #797020 - Flags: feedback?(vchang) → feedback+
Blocks: 887699
Depends on: 925676
No longer blocks: 887699
No longer blocks: 923382
Comment on attachment 797020 [details] [diff] [review]
WIP, Part1: Interface changes, v3

Because we still have a lot of things under discussion, so cancel the feedback request first.
Attachment #797020 - Flags: feedback?(vyang)
Depends on: 939046
No longer blocks: 904514
Component: General → RIL
Put this bug into backlog.
blocking-b2g: --- → backlog
No longer blocks: 969268
Hey Wesley, is this bug intended for 2.1?
Flags: needinfo?(whuang)
(In reply to Anshul from comment #15)
> Hey Wesley, is this bug intended for 2.1?

Hey Anshul, no, it's not.
Flags: needinfo?(whuang)
feature-b2g: --- → 2.3?
Use feature-b2g:3.0? rather than 2.3?.
feature-b2g: 2.3? → 3.0?
Whiteboard: [grooming]
blocking-b2g: backlog → ---
Per offline discussion with Edgar, we decided to mark this bug as a meta bug, and file sub-bugs to:
- put all information needed by other modules into a separate interface - nsINetworkInfo
- Add activate()/deactivate in nsINetworkInterface and RIL implementation (probably bug 911713)
- Implement nsINetworkInterface.active()/deactive in wifi network interface
and other bugs that may come to mind later...
Summary: B2G NetworkManager: Redefine the nsINetworkInterface → [meta] B2G NetworkManager: Redefine the nsINetworkInterface
No longer blocks: 911713
Depends on: 911713
Assignee: echen → nobody
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: