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
Edit
Edit
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)
How can we help?
A premium WordPress theme with integrated Knowledge Base,
providing 24/7 community based support.