|  Developer
Updated on January 10, 2023

start_dhcp_discovery()

  • Creates a subscription on DHCP events.
Edit
Edit
fields type description
path string The path to notification script.
operations string[] The list of event names to subscribe to, one of: , , ,
Edit
subscriptionId: string
Edit
result table fields:
fields type description
event string Event name, one of: , , ,
data table DHCP event data.
Edit
data table fields
fields type description
id string Subscription Identifier
client_address string MAC address of “sender” (from Ethernet protocol header)
destination_address string MAC-address of “destination” (from Ethernet protocol header)
ip_source string IP-address, specific to every DHCP command.
ip_destination string IP-address, specific to every DHCP command.
params object event-specific data
Edit
See list of fields specific to every DHCP command:
Edit
fields type description
id string Subscription Identifier
client_address string MAC address of “sender”
destination_address string MAC address of “destination”
ip_source string The last know ip address from a client
ip_destination string the specific subnet broadcast address
params object event-specific data
params.hostname string (optional) Client host name
Edit
fields type description
id string Subscription Identifier
client_address string MAC address of “sender”
destination_address string MAC address of “destination”
ip_source string IP of DHCP server
ip_destination string the specific subnet broadcast address
params object Offered data to client
params.ip string Offered IP
params.mask string Offered subnet address
params.gateway string Offered gateway/router IP
params.lease_time integer IP address lease time in seconds
params.dhcp string DHCP IP address
params.dns string[] DNS servers’ IP array
params.domain_name string Domain name
params.ntp string NTP servers list
Edit
fields type description
id string Subscription Identifier
client_address string MAC address of “sender”
destination_address string MAC address of “destination”
ip_source string The last know ip address from a client
ip_destination string the specific subnet broadcast address
params object event-specific data
params.ip string Requested IP address
params.hostname string (optional) Requested host name
params.gateway string Requested gateway IP address
params.ntp string NTP servers list
Edit
fields type description
id string Subscription Identifier
client_address string MAC address of “sender”
destination_address string MAC address of “destination”
ip_source string IP of DHCP server
ip_destination string the specific subnet broadcast address
params object Offered data to client
params.ip string Offered IP
params.mask string Offered subnet address
params.gateway string Offered gateway/router IP
params.lease_time integer IP address lease time in seconds
params.dhcp string DHCP IP address
params.dns string[] DNS servers’ IP array
params.domain_name string Domain name
params.ntp string NTP servers list
Edit
				
					local network = require('network')

local value = 'unknown result'

local subscriptionId = network.start_listening_dhcp("HUB:path/to/script", ["request", "discovery", "offer", "acknowledgement"])

value = network.stop_listening_dhcp(subscriptionId)