metaonly module ti.ndk.config.Dns |
 |
 |
 |
NDK module used for creating and configuring a DNS server
The Dns module can be used to configure and create a DNS server in
an NDK program.
[
more ... ]
var Dns = xdc.useModule('ti.ndk.config.Dns');
module-wide constants & types
module-wide config parameters
per-instance config parameters
per-instance creation
DETAILS
The Dns module can be used to configure and create a DNS server in
an NDK program.
In order to configure a DNS server, users must create a Dns module
parameters structure, which contains all of the instance properties of a
Dns instance. Once the parameter structure is created, it may be used
to change the properties of the DNS server that's being created.
Users are able to create multiple DNS servers by creating multiple Dns
module instances, and configuring each one. However, if multiple Dns
instances are created, one must be careful to ensure that they all
have been configured to have unique and free port numbers.
const Dns.CIS_FLG_CALLBYIP |
 |
Specifies that the service should be invoked by IP address
const Dns.CIS_FLG_CALLBYIP = 0x0004;
const Dns.CIS_FLG_IFIDXVALID |
 |
Specifies if the IfIdx field is valid
const Dns.CIS_FLG_IFIDXVALID = 0x0001;
const Dns.CIS_FLG_RESOLVEIP |
 |
Requests that IfIdx be resolved to an IP address before service
execution is initiated
const Dns.CIS_FLG_RESOLVEIP = 0x0002;
const Dns.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 Dns.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.
config Dns.externDnsServIp // module-wide |
 |
Used to specify an external DNS Server
Dns.externDnsServIp = String null;
Instance Config Parameters |
 |
var params = new Dns.Params;
// Instance config-params object
params.ifIdx = Int 1;
// The physical device index on which the DNS server shall be
executed. Must be greater than zero
params.ipAddr = String "INADDR_ANY";
// The IP address on which to initiate this service
params.mode = Bits16 0;
// Set of flags which represent the desired behavior of the DNS Server
params.pCbSrv = Void(*)(Int,Int,Int,Void*) '&ti_ndk_config_Global_serviceReport';
// Dns service reporting function
config Dns.Params.ifIdx // instance |
 |
The physical device index on which the DNS server shall be
executed. Must be greater than zero
var params = new Dns.Params;
...
params.ifIdx = Int 1;
config Dns.Params.ipAddr // instance |
 |
The IP address on which to initiate this service
var params = new Dns.Params;
...
params.ipAddr = String "INADDR_ANY";
DETAILS
To accept a connection from any IP, specify INADDR_ANY.
config Dns.Params.mode // instance |
 |
Set of flags which represent the desired behavior of the DNS Server
var params = new Dns.Params;
...
params.mode = Bits16 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
address before 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 Dns.Params.pCbSrv // instance |
 |
Dns service reporting function
var params = new Dns.Params;
...
params.pCbSrv = Void(*)(Int,Int,Int,Void*) '&ti_ndk_config_Global_serviceReport';
Static Instance Creation |
 |
// Allocate instance config-params
params.config = ...
// Assign individual configs
var inst = Dns.create(params);
// Create an instance-object
generated on Tue, 25 Aug 2020 01:58:54 GMT