Skip to end of metadata
Go to start of metadata

Versions

org.rdk.Network.1 - initial version of the Network API.

Methods

getInterfaces  (v1)

Description:  Returns a list of interfaces supported by this device including their state.

Arguments:  none

Returns:  interfaces::Array - an array of strings of the network interfaces

Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.getInterfaces", "params":{}}

Response: {"jsonrpc":"2.0", "id":3, "result": {"interfaces": 
[
  {
    "interface":"WIFI",
    "macAddress":"AA:AA:AA:AA:AA:AA",
    "enabled":true,
    "connected":true
  },
  {
    "interface":"MOCHA",
    "macAddress":"AA:AA:AA:AA:AA:AB",
    "enabled":false,
    "connected":false
  },
  {
    "interface":"ETHERNET",
    "macAddress":"AA:AA:AA:AA:AA:AD",
    "enabled":false,
    "connected":false
  }
]
} }

uint32_t mn(const JsonObject& parameters, JsonObject& response);

isInterfaceEnabled  (v1)

Description:  Returns true if the specified interface is enabled

Arguments:  interface::String

Returns:  enabled:boolean

Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.isInterfaceEnabled", "params":{"interface":"WIFI"}}

Response: {"jsonrpc":"2.0", "id":3, "result": {"enabled":true} }

uint32_t mn(const JsonObject& parameters, JsonObject& response);


setInterfaceEnabled  (v1)

Description:  Enables the specified interface when enables is true.  Disables when enabled is false.

Arguments: 

  • interface::String
  • enabled::boolean
  • persist::boolean

Returns: 

Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.setInterfaceEnabled", "params":{"interface":"WIFI", "enabled":true, "persist":true}}

Response: {"jsonrpc":"2.0", "id":3, "result": 0}

uint32_t mn(const JsonObject& parameters, JsonObject& response);



setDefaultInterface  (v1)

Description:  Sets the default interface.  This should fail if the interface is not enabled.

Arguments:

  • interface :: String - the interface that will be the default
  • persist :: boolean - when true, this interface will be enabled as the default interface currently AND on the next reboot.  When false, this interface will only be the default during this session.

Returns: None

Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.setDefaultInterface", "params":{ "interface":"WIFI", "persist":true}}

Response: {"jsonrpc":"2.0", "id":3, "result": {}}

uint32_t mn(const JsonObject& parameters, JsonObject& response);


getDefaultInterface  (v1)

Description:  Gets the default network interface.  The active network interface is defined as the one that can make requests to the external network. Returns one of the supported interfaces as per getInterfaces, or "" indicating that there is no default network interface.

Arguments:  none

Returns:  interface::String

Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.getDefaultInterface", "params":{}}

Response: {"jsonrpc":"2.0", "id":3, "result": {"interface":"WIFI"}}

uint32_t mn(const JsonObject& parameters, JsonObject& response);


getStbIp  (v1)

Description:  Gets the IP address of the default interface.

Arguments:  none

Returns:  ip : String

Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.getStbIp", "params":{}}

Response: {"jsonrpc":"2.0","id":3,"result":{"ip":"10.42.0.213","success":true}}

uint32_t mn(const JsonObject& parameters, JsonObject& response);



ping (v1)

Description:  Pings the specified endpoint host name or IP address.  The ping command will send the specified number of packets to the endpoint.  Default packets is 15.

Arguments:

  • endpoint::String
  • packets::int

Returns:

  • results::Object

Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.ping", "params":{
  "endpoint": "45.57.221.20",
  "packets": 10
}}

Response: {"jsonrpc":"2.0", "id":3, "result":{
  "target" : "173.194.123.7",
  "success" : true,
  "packetsTransmitted" : 10,
  "packetsReceived" : 10,
  "packetLoss" : "0.0",
  "tripMin" : "61.264",
  "tripAvg" : "130.397",
  "tripMax" : "230.832",
  "tripStdDev" : "80.919",
  "error" : null
}}

uint32_t ping(const JsonObject& parameters, JsonObject& response);


pingNamedEndpoint (v1)

Description:  Pings the endpoint named by endpointName.  Only names returned by getNamedEndpoints can be used.  The named endpoint will be resolved to a specific host or ip address on the device side base on the endpointName. The ping command will send the specified number of packets to the endpoint.  Default packets is 15. 

Arguments:

  • endpointName::String
  • packets::int

Returns:

  • results::Object


Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.pingNamedEndpoint", "params":{
"endpointName": "CMTS",
"packets": 10
}}

Response: {"jsonrpc":"2.0", "id":3, "result":{
  "target" : "173.194.123.7",
  "success" : true,
  "packetsTransmitted" : 10,
  "packetsReceived" : 10,
  "packetLoss" : "0.0",
  "tripMin" : "61.264",
  "tripAvg" : "130.397",
  "tripMax" : "230.832",
  "tripStdDev" : "80.919",
  "error" : null
}}
 uint32_t pingNamedEndpoint(const JsonObject& parameters, JsonObject& response);


trace (v1)

Description:  Traces the specified endpoint host name or IP address using traceroute.  The trace command will send the specified number of packets to the endpoint.  Default packets is 15.

Arguments:

  • endpoint::String
  • packets::int

Returns:

  • results

Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.trace", "params":{
"endpoint": "45.57.221.20",
"packets": 10
}}

Response: {"jsonrpc":"2.0", "id":3, "result":{
  "target" : "173.194.123.7",
  "success" : true,
  "error" : null,
  "results" : "<<<traceroute command results>>>"
}}

uint32_t trace(const JsonObject& parameters, JsonObject& response);


traceNamedEndpoint (v1)

Description:  Traces the specified endpoint host name or IP address using traceroute.  The trace command will send the specified number of packets to the endpoint.  Default packets is 15.

Arguments:

  • endpointName::String
  • packets::int

Returns:


Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.traceNamedEndpoint", "params":{
"guid": "iasoviubejcv",
"endpointName": "CMTS",
"packets": 10
}}

Response: {"jsonrpc":"2.0", "id":3, "result":{
Response: {"jsonrpc":"2.0", "id":3, "result":{
  "target" : "173.194.123.7",
  "success" : true,
  "error" : null,
  "results" : "<<<traceroute command results>>>"
}}

 uint32_t traceNamedEndpoint(const JsonObject& parameters, JsonObject& response);


getNamedEndpoints (v1)

Description: Returns a list of endpoint names.  Currently supported endpoint names are:  CMTS

Arguments:  None

Returns:  endpoints:Array - an array of named endpoints for use in pingNamedEndpoints or traceNamedEndpoint.


Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.getNamedEndpoints", "params":{}}

Response: {"jsonrpc":"2.0", "id":3, "result":{"endpoints":["CMTS"]}}

uint32_t getNamedEndpoints(const JsonObject& parameters, JsonObject& response);


getIPSettings (v1)

Description: Gets the IP setting for the given interface

Arguments: 

  • interface : String -  ethernet or wifi, depending upon availability of given interface in getInterfaces

Returns: 

  • interface : String - the interface provided as an arg to this method
  • ipversion : String - either IPv4 or IPv6
  • autoconfig : boolean - true if DHCP is used, false if configured manually
  • ipaddr : String - IPv4
  • netmask : String
  • gateway : String
  • primarydns : String
  • secondarydns : String


Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.getIPSettings", "params":{ "interface": "wifi" }}

Response: {"jsonrpc":"2.0", "id":3, "result":{
  "interface": "wifi",
  "ipversion": "IPv4
  "autoconfig": true, 
  "ipaddr": “192.168.1.101", 
  "netmask": "255.255.255.0",  
  "gateway": "192.168.1.1", 
  "primarydns": "192.168.1.1", 
  "secondarydns": ""
} }



setIPSettings (v1)

Description:  Sets the IP settings

Arguments:

  • interface : String - ethernet or wifi, depending upon availability of given interface in getInterfaces
  • ipversion : String - "IPv4" is the only value supported when manually setting IP addresses
  • autoconfig : boolean - true if DHCP is used, false if configured manually
  • ipaddr : String - IPv4 address
  • netmask : String
  • gateway : String
  • primarydns : String
  • secondarydns : String

Returns:

  • supported : boolean - returns true if setting the IP settings are supported.  Returns false if not supported.
  • success : boolean - returns true if the settings were successfully set


Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.setIPSettings", "params":{
  "interface": "wifi",
  "ipversion": "IPv4",
  "autoconfig": true, 
  "ipaddr": “192.168.1.101", 
  "netmask": "255.255.255.0",  
  "gateway": "192.168.1.1", 
  "primarydns": "192.168.1.1", 
  "secondarydns": ""
}}

Response: {"jsonrpc":"2.0", "id":3, "result":{
  "supported": true,
  "success": true
} }



Events

onConnectionStatusChanged  (v1)

Description:  Fired when a connection is made or lost

Payload: 

  • interface::String,
  • status::String - either "CONNECTED" or "DISCONNECTED"
{
  "jsonrpc":"2.0", 
  "method":"org.rdk.Network.1.onConnectionStatusChanged", 
  "params": {"interface":"WIFI", status:"CONNECTED"} 
}


onIPAddressStatusChanged  (v1)

Description:  Fired when an IP Address is assigned or lost

Payload: 

  • interface::String
  • ip6Address::String
  • ip4Address::String
  • status::String - either "ACQUIRED" or "LOST"
{
  "jsonrpc":"2.0", 
  "method":"org.rdk.Network.1.onIPAddressStatusChanged", 
  "params": {
    "interface":"WIFI", 
    "ip6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", 
    "ip4Address":"106.146.207.16", 
    "status":"ACQUIRED"} 
}


onDefaultInterfaceChanged (v1)

Description:  Fired when the default interface changes, regardless if from a system operation or through this API

Payload:

  • oldInterfaceName::String
  • newInterfaceName::String
{
  "jsonrpc":"2.0", 
  "method":"org.rdk.Network.1.onDefaultInterfaceChanged", 
  "params": {
    "oldInterfaceName":"ETHERNET",
    "newInterfaceName":"WIFI" 
  } 
}


onInterfaceStatusChanged (v1)

Description:  Fired when the an interface becomes enabled or disabled

Payload:

  • interface::String
  • enabled::boolean
{
  "jsonrpc":"2.0", 
  "method":"org.rdk.Network.1.onInterfaceStatusChanged", 
  "params": {
    "interface":"WIFI",
    "enabled":true 
  } 
}
  
  • No labels