Version: 1.0
Status: ⚫⚫⚫
DHCPServer plugin for Thunder framework.
This document describes purpose and functionality of the DHCPServer plugin. It includes detailed specification about its configuration, methods and properties provided.
All identifiers of the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.
The table below provides and overview of acronyms used in this document and their definitions.
Acronym | Description |
---|---|
API | Application Programming Interface |
DHCP | Dynamic Host Configuration Protocol |
HTTP | Hypertext Transfer Protocol |
JSON | JavaScript Object Notation; a data interchange format |
JSON-RPC | A remote procedure call protocol encoded in JSON |
The table below provides and overview of terms and abbreviations used in this document and their definitions.
Term | Description |
---|---|
callsign | The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique. |
Ref ID | Description |
---|---|
DHCP | DHCP protocol specification (RFC2131) |
HTTP | HTTP specification |
JSON-RPC | JSON-RPC 2.0 specification |
JSON | JSON specification |
Thunder | Thunder API Reference |
The table below lists configuration options of the plugin.
Name | Type | Description |
---|---|---|
callsign | string | Plugin instance name (default: DHCPServer) |
classname | string | Class name: DHCPServer |
locator | string | Library name: libThunderDHCPServer.so |
startmode | string | Determines if the plugin shall be started automatically along with the framework |
configuration | object | Server configuration |
configuration.name | string | Name of the server |
configuration.servers | array | List of configured DHCP servers |
configuration.servers[#] | object | Configuration of a server |
configuration.servers[#].interface | string | Name of the network interface to bind to |
configuration.servers[#].poolstart | number | IP pool start number |
configuration.servers[#].poolsize | number | IP pool size (in IP numbers) |
configuration.servers[#]?.router | number | (optional) IP of router |
This plugin implements the following interfaces:
- DHCPServer.json (version 1.0.0) (compliant format)
The following methods are provided by the DHCPServer plugin:
DHCPServer interface methods:
Method | Description |
---|---|
activate | Activates a DHCP server |
deactivate | Deactivates a DHCP server |
activate method
Activates a DHCP server.
Name | Type | Description |
---|---|---|
params | object | |
params.interface | string | Network interface name |
Name | Type | Description |
---|---|---|
result | null | Always null |
Code | Message | Description |
---|---|---|
1 | ERROR_GENERAL |
Failed to activate server |
22 | ERROR_UNKNOWN_KEY |
Invalid interface name given |
5 | ERROR_ILLEGAL_STATE |
Server is already activated |
{
"jsonrpc": "2.0",
"id": 42,
"method": "DHCPServer.1.activate",
"params": {
"interface": "eth0"
}
}
{
"jsonrpc": "2.0",
"id": 42,
"result": null
}
deactivate method
Deactivates a DHCP server.
Name | Type | Description |
---|---|---|
params | object | |
params.interface | string | Network interface name |
Name | Type | Description |
---|---|---|
result | null | Always null |
Code | Message | Description |
---|---|---|
1 | ERROR_GENERAL |
Failed to deactivate server |
22 | ERROR_UNKNOWN_KEY |
Invalid interface name given |
5 | ERROR_ILLEGAL_STATE |
Server is not activated |
{
"jsonrpc": "2.0",
"id": 42,
"method": "DHCPServer.1.deactivate",
"params": {
"interface": "eth0"
}
}
{
"jsonrpc": "2.0",
"id": 42,
"result": null
}
The following properties are provided by the DHCPServer plugin:
DHCPServer interface properties:
Property | Description |
---|---|
status RO | Server status |
status property
Provides access to the server status.
This property is read-only.
The server argument shall be passed as the index to the property, e.g. DHCPServer.1.status@eth0. If omitted, status of all configured servers is returned.
Name | Type | Description |
---|---|---|
result | array | List of configured servers |
result[#] | object | |
result[#].interface | string | Network interface name |
result[#].active | boolean | Denotes if server is currently active |
result[#]?.begin | string | (optional) IP address pool start |
result[#]?.end | string | (optional) IP address pool end |
result[#]?.router | string | (optional) Router IP address |
result[#]?.leases | array | (optional) List of IP address leases |
result[#]?.leases[#] | object | (optional) Lease description |
result[#]?.leases[#].name | string | Client identifier (or client hardware address if identifier is absent) |
result[#]?.leases[#].ip | string | Client IP address |
result[#]?.leases[#]?.expires | string | (optional) Client IP expiration time (in ISO8601 format, empty: never expires) |
Code | Message | Description |
---|---|---|
22 | ERROR_UNKNOWN_KEY |
Invalid server name given |
{
"jsonrpc": "2.0",
"id": 42,
"method": "DHCPServer.1.status@eth0"
}
{
"jsonrpc": "2.0",
"id": 42,
"result": [
{
"interface": "eth0",
"active": true,
"begin": "192.168.0.10",
"end": "192.168.0.100",
"router": "192.168.0.1",
"leases": [
{
"name": "00e04c326c56",
"ip": "192.168.0.10",
"expires": "2019-05-07T07:20:26Z"
}
]
}
]
}