metaonly module ti.ndk.config.Telnet |
 |
 |
 |
NDK module used for creating and configuring a telnet server
The Telnet module can be used to configure and create a telnet server in
an NDK program.
[
more ... ]
var Telnet = xdc.useModule('ti.ndk.config.Telnet');
module-wide constants & types
per-instance config parameters
per-instance creation
DETAILS
The Telnet module can be used to configure and create a telnet server in
an NDK program.
In order to configure a telnet server, users must create a Telnet module
parameters structure, which contains all of the instance properties of a
Telnet instance. Once the parameter structure is created, it may be used
to change the properties of the telnet server that's being created.
Users are able to create multiple telnet servers by creating multiple
Telnet instances, and configuring each one. However, if multiple Telnet
instances are created, one must be careful to ensure that they all
have been configured to have unique and free port numbers.
const Telnet.CIS_FLG_CALLBYIP |
 |
Specifies that the service should be invoked by IP address
const Telnet.CIS_FLG_CALLBYIP = 0x0004;
const Telnet.CIS_FLG_IFIDXVALID |
 |
Specifies if the IfIdx field is valid
const Telnet.CIS_FLG_IFIDXVALID = 0x0001;
const Telnet.CIS_FLG_RESOLVEIP |
 |
Requests that IfIdx be resolved to an IP address before service
execution is initiated
const Telnet.CIS_FLG_RESOLVEIP = 0x0002;
const Telnet.CIS_FLG_RESTARTIPTERM |
 |
A service that is dependent on a valid IP address (as determined by the
RESOLVEIP flag) is shut down if the IP address becomes invalid
const Telnet.CIS_FLG_RESTARTIPTERM = 0x0008;
DETAILS
When this flag is set, the service will be restarted when a new address
becomes available. Otherwise; the service will not be restarted.
Instance Config Parameters |
 |
var params = new Telnet.Params;
// Instance config-params object
params.callBackFxn = Int(*)(Void*) null;
// Telnet callback function. This is a handle to the function which
contains the telnet server code
params.ifIdx = Int 1;
// The physical device index on which the telnet server shall be
executed. Must be greater than zero
params.ipAddr = String "INADDR_ANY";
// The IP address on which to initiate this service
params.maxCon = Int 8;
// The maximum number of connections for the telnet server (1 - 24)
params.mode = Int 0;
// Set of flags which represent the desired behavior of the telnet Server
params.pCbSrv = Void(*)(Int,Int,Int,Void*) '&ti_ndk_config_Global_serviceReport';
// Telnet service reporting function
params.port = Int 23;
// The port number which this telnet server will accept connections
config Telnet.Params.callBackFxn // instance |
 |
Telnet callback function. This is a handle to the function which
contains the telnet server code
var params = new Telnet.Params;
...
params.callBackFxn = Int(*)(Void*) null;
config Telnet.Params.ifIdx // instance |
 |
The physical device index on which the telnet server shall be
executed. Must be greater than zero
var params = new Telnet.Params;
...
params.ifIdx = Int 1;
config Telnet.Params.ipAddr // instance |
 |
The IP address on which to initiate this service
var params = new Telnet.Params;
...
params.ipAddr = String "INADDR_ANY";
DETAILS
To accept a connection from any IP, specify INADDR_ANY.
config Telnet.Params.maxCon // instance |
 |
The maximum number of connections for the telnet server (1 - 24)
var params = new Telnet.Params;
...
params.maxCon = Int 8;
config Telnet.Params.mode // instance |
 |
Set of flags which represent the desired behavior of the telnet Server
var params = new Telnet.Params;
...
params.mode = Int 0;
DETAILS
The following flag values may be set either individually, or by or-ing
flags together:
- CIS_FLG_IFIDXVALID - specifies if the IfIdx field is valid.
- CIS_FLG_RESOLVEIP - Requests that IfIdx be resolved to an IP
addressbefore service execution is initiated.
- CIS_FLG_CALLBYIP - Specifies that the service should be invoked by
IP address
- CIS_FLG_RESTARTIPTERM - A service that is dependent on a valid IP
address.
config Telnet.Params.pCbSrv // instance |
 |
Telnet service reporting function
var params = new Telnet.Params;
...
params.pCbSrv = Void(*)(Int,Int,Int,Void*) '&ti_ndk_config_Global_serviceReport';
config Telnet.Params.port // instance |
 |
The port number which this telnet server will accept connections
var params = new Telnet.Params;
...
params.port = Int 23;
Static Instance Creation |
 |
var params =
new Telnet.
Params;
// Allocate instance config-params
params.config = ...
// Assign individual configs
var inst = Telnet.create(params);
// Create an instance-object
generated on Fri, 05 Feb 2016 20:07:57 GMT