/pps/services/networking/control

The Network Manager listens for commands on this control object

Publishers
Any app
Subscribers
Network Manager; any app
Note: This type of object is known as a server object, a special PPS object designed for point-to-point communication between a server and one or more clients. For details, see "Server objects" in the Persistent Publish/Subscribe Developer's Guide.

Message/response format

Commands sent to the /pps/services/networking/control object are of the form:

msg::command_string\nid::ID_number\ndat:json:{JSON_data}

Responses always reflect the command_string and ID_number that were sent in the message, along with any errors:

res::command_string\nid::ID_number\ndat:json:{JSON_data}\nerr::error_description

Commands

The control object accepts the following commands:
net_connected
Informs the Network Manager of a network link becoming available. Contains the connected interface and specified networking parameters. The interface is that given by the ifconfig utility.
net_disconnecting
Informs the Network Manager of an imminent shutdown of the specified interface, allowing clients to clean up gracefully before the interface is torn down.
Note: The Network Manager will publish notice of the impending shutdown to the /pps/services/networking/all/interfaces/<interface> object.
net_disconnected
The interface that was disconnected.
net_dyn
Supplies the Network Manager with dynamic configuration data. The response will contain a simple err:: attribute on error, empty on success.

The following table shows the command format:

msg:: id:: dat:json:
net_connected Number ["interface"{"parameter":"value", ...}] (see below)
net_disconnected Number interface
net_disconnecting Number ["interface" | "interface",{"deadline":milliseconds}]
net_dyn Number ["interface",{"gateway":"addr","nameservers":["addr", "addr"],"searchdomains":"domain"}]

Networking parameters

Parameter Description
ftpproxy IPv4 FTP proxy.
ftpproxy6 IPv6 FTP proxy.
htpproxy IPv4 HTTP proxy.
htpproxy6 IPv6 HTTP proxy.
httpsroxy IPv4 HTTPS proxy.
httpsproxy6 IPv6 HTTPS proxy.
manual Possible values:
  • yes—if set, these settings apply:
    • ip_address=
    • gateway=
    • netmask=
    • nameservers=
    • searchdomains=
  • no—if set, these settings apply:
    • dhcp=on|off|auto
    • dhcp6=on|off|auto
manual6 Possible values:
  • yes—if set, these settings apply:
    • ip6_address=
    • ip6_netmask=
type The type of network interface. Possible values:
  • bb (any BlackBerry Bridge BIS-B/BES-B or BBIO HTTP proxy connection)
  • bluetooth_dun (any Bluetooth tethering interface)
  • cellular (any cellular network interface)
  • usb (any direct USB cable to a PC or Mac)
  • vpn (any VPN tunnel)
  • wifi (any wireless network interface)
  • wired (any wired Ethernet interface)

Requesting a ping or traceroute

You can send ping or traceroute networking commands in the dat:: field. Reply will contain a simple err:: attribute on error, empty on success.

For example, a client can write:
msg::cmd
id::5
dat::ping -n -c4 10.42.116.1