tftpServer
- Description:
- The Device TFTP Server library.
Allows drivers to execute a TFTP server on network collector
Both GET and PUT tftp methods are available
Example
D.tftpServer
See TFTP Driver Examples
Methods
(static) accept(options, onReady, onUploadEnd)
- Description:
- Start a TFTP server on network collector that is able to receive a single PUT request from a TFTP client on a file
Example
D.tftpServer.accept(options, onReady, onUploadEnd)
Parameters:
Name |
Type |
Description |
options |
Object
|
The tftpServer accept options
Properties
Name |
Type |
Attributes |
Default |
Description |
filePath |
string
|
|
|
The file path against which a TFTP client will execute a PUT request |
port |
string
|
<optional>
|
69
|
The port number of the TFTP server. |
blockSize |
number
|
<optional>
|
1468
|
The size of each DATA block in bytes. Must be between 8 and 65464. |
windowSize |
number
|
<optional>
|
4
|
The number of blocks that can be sent or received without waiting for an acknowledgment. Valid values range from 1 to 65535. |
timeout |
number
|
<optional>
|
3000
|
The time in milliseconds after which the file will be not accepted anymore by the TFTP server. |
strictIpCheck |
boolean
|
<optional>
|
false
|
A boolean value if the TFTP server shall ensure only D.device.ip can execute PUT over this file. |
|
onReady |
callback
|
The tftpServer onReady callback
Properties
Name |
Type |
Attributes |
Description |
error |
ErrorResult
|
<optional>
|
Will be present if the TFTP server failed to start |
host |
string
|
<optional>
|
The TFTP server IP address |
port |
string
|
<optional>
|
The TFTP server port |
|
onUploadEnd |
callback
|
The tftpServer onUploadEnd callback
Properties
Name |
Type |
Attributes |
Description |
error |
ErrorResult
|
<optional>
|
Will be present if the execution resulted in an error |
content |
string
|
<optional>
|
The content received with the PUT request |
|
(static) serve(options, onReady)
- Description:
- Start a TFTP server on network collector that is able to receive a single GET request from a TFTP client on a file
Example
D.tftpServer.serve(options, onReady)
Parameters:
Name |
Type |
Description |
options |
object
|
The tftpServer serve options
Properties
Name |
Type |
Attributes |
Default |
Description |
filePath |
string
|
|
|
The file path against which a TFTP client will execute a GET request |
content |
string
|
|
|
The content of the file the TFTP clients will receive with a GET request |
port |
string
|
<optional>
|
69
|
The port number of the TFTP server. |
blockSize |
number
|
<optional>
|
1468
|
The size of each DATA block in bytes. Must be between 8 and 65464. |
windowSize |
number
|
<optional>
|
4
|
The number of blocks that can be sent or received without waiting for an acknowledgment. Valid values range from 1 to 65535. |
timeout |
number
|
<optional>
|
3000
|
The time in milliseconds after which the file will be not accepted anymore by the TFTP server. |
strictIpCheck |
boolean
|
<optional>
|
false
|
A boolean value if the TFTP server shall ensure only D.device.ip can execute GET over this file. |
|
onReady |
callback
|
The tftpServer onReady callback
Properties
Name |
Type |
Attributes |
Description |
error |
ErrorResult
|
<optional>
|
Will be present if the TFTP server failed to start |
host |
string
|
<optional>
|
The TFTP server IP address |
port |
string
|
<optional>
|
The TFTP server port |
|