metaonly module ti.ndk.config.DhcpServer

NDK module for creating and configuring a DHCP server

The DhcpServer module can be used to configure and create a DHCP server in an NDK application. [ more ... ]
Configuration settings sourced in ti/ndk/config/DhcpServer.xdc
var DhcpServer = xdc.useModule('ti.ndk.config.DhcpServer');
module-wide constants & types
per-instance config parameters
    var params = new DhcpServer.Params// Instance config-params object;
        params.ipAddrPoolBase// The first IP address of the DHCP server address pool = String "192.168.1.2";
        params.pCbSrv// DhcpServer service reporting function = Void(*)(Int,Int,Int,Void*) '&ti_ndk_config_Global_serviceReport';
per-instance creation
    var inst = DhcpServer.create// Create an instance-object(params);
 
DETAILS
The DhcpServer module can be used to configure and create a DHCP server in an NDK application.
In order to configure a DHCP server, users must create a DhcpServer module parameters structure, which contains all of the instance properties of a DhcpServer instance. Once the parameter structure is created, it may be used to change the properties of the DHCP server that's being created.
Users are able to create multiple DHCP servers by creating multiple DhcpServer instances, and configuring each one. However, if multiple DhcpServer instances are created, one must be careful to ensure that they all have been configured to have unique and free port numbers.
 
const DhcpServer.DHCPS_FLG_LOCALDNS

Causes DHCP Server to report its own IP address as the local DNS server to clients

Configuration settings
const DhcpServer.DHCPS_FLG_LOCALDNS = 0x0001;
 
DETAILS
If this flag is not set, the DHCP server reports the DNS servers as contained in the SYSINFO portion of the configuration.
 
const DhcpServer.DHCPS_FLG_LOCALDOMAIN

Causes DHCP Server to report the local domain name assigned to the virtual network to clients

Configuration settings
const DhcpServer.DHCPS_FLG_LOCALDOMAIN = 0x0002;
 
DETAILS
If this flag is not set, the DHCP Server reports the public domain name to its clients.
Instance Config Parameters

Configuration settings
var params = new DhcpServer.Params;
// Instance config-params object
    params.ifIdx = Int 1;
    // The physical device index on which the DHCP server shall be executed. Must be greater than zero
    params.ipAddrPoolBase = String "192.168.1.2";
    // The first IP address of the DHCP server address pool
    params.ipAddrPoolCount = Int 253;
    // The number of IP addresses in the DHCP server address pool
    params.localDNS = Bool false;
    // Causes DHCP Server to report its own IP address as the local DNS server to clients
    params.localDomain = Bool false;
    // Causes DHCP Server to report the local domain name assigned to the virtual network to clients
    params.pCbSrv = Void(*)(Int,Int,Int,Void*) '&ti_ndk_config_Global_serviceReport';
    // DhcpServer service reporting function
 
config DhcpServer.Params.ifIdx  // instance

The physical device index on which the DHCP server shall be executed. Must be greater than zero

Configuration settings
var params = new DhcpServer.Params;
  ...
params.ifIdx = Int 1;
 
 
config DhcpServer.Params.ipAddrPoolBase  // instance

The first IP address of the DHCP server address pool

Configuration settings
var params = new DhcpServer.Params;
  ...
params.ipAddrPoolBase = String "192.168.1.2";
 
 
config DhcpServer.Params.ipAddrPoolCount  // instance

The number of IP addresses in the DHCP server address pool

Configuration settings
var params = new DhcpServer.Params;
  ...
params.ipAddrPoolCount = Int 253;
 
 
config DhcpServer.Params.localDNS  // instance

Causes DHCP Server to report its own IP address as the local DNS server to clients

Configuration settings
var params = new DhcpServer.Params;
  ...
params.localDNS = Bool false;
 
 
config DhcpServer.Params.localDomain  // instance

Causes DHCP Server to report the local domain name assigned to the virtual network to clients

Configuration settings
var params = new DhcpServer.Params;
  ...
params.localDomain = Bool false;
 
 
config DhcpServer.Params.pCbSrv  // instance

DhcpServer service reporting function

Configuration settings
var params = new DhcpServer.Params;
  ...
params.pCbSrv = Void(*)(Int,Int,Int,Void*) '&ti_ndk_config_Global_serviceReport';
 
Static Instance Creation

Configuration settings
var params = new DhcpServer.Params;
// Allocate instance config-params
params.config =   ...
// Assign individual configs
 
var inst = DhcpServer.create(params);
// Create an instance-object
generated on Tue, 25 Aug 2020 01:58:54 GMT