1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32 33 34 35 36
37
38 /*!
39 * ======== DhcpServer ========
40 * NDK module for creating and configuring a DHCP server.
41 *
42 * The DhcpServer module can be used to configure and create a DHCP server in
43 * an NDK application.
44 *
45 * In order to configure a DHCP server, users must create a DhcpServer module
46 * parameters structure, which contains all of the instance properties of a
47 * DhcpServer instance. Once the parameter structure is created, it may
48 * be used to change the properties of the DHCP server that's being created.
49 *
50 * Users are able to create multiple DHCP servers by creating multiple
51 * DhcpServer instances, and configuring each one. However, if multiple
52 * DhcpServer instances are created, one must be careful to ensure that
53 * they all have been configured to have unique and free port numbers.
54 */
55
56 @Template("./DhcpServer.xdt")
57
58 metaonly module DhcpServer {
59
60 /*! Function signature for CISARGS struct service reporting function */
61 typedef Void (*dhcpServerServiceFxn)(Int, Int, Int, Void *);
62
63 /*! Type used to specify bits in flags config parameter */
64 typedef Bits16 DhcpServerFlag;
65
66 /*!
67 * Causes DHCP Server to report its own IP address as the local DNS server
68 * to clients
69 *
70 * If this flag is not set, the DHCP server reports the DNS servers as
71 * contained in the SYSINFO portion of the configuration.
72 */
73 const DhcpServerFlag DHCPS_FLG_LOCALDNS = 0x0001;
74
75 /*!
76 * Causes DHCP Server to report the local domain name assigned to the
77 * virtual network to clients.
78 *
79 * If this flag is not set, the DHCP Server reports the public domain
80 * name to its clients.
81 */
82 const DhcpServerFlag DHCPS_FLG_LOCALDOMAIN = 0x0002;
83
84 85 86
87
88 /*!
89 * ======== create ========
90 * Creates an DhcpServer instance.
91 */
92 create();
93
94 instance:
95 /*! The first IP address of the DHCP server address pool */
96 config String ipAddrPoolBase = "192.168.1.2";
97
98 /*! The number of IP addresses in the DHCP server address pool */
99 config Int ipAddrPoolCount = 253;
100
101 /*!
102 * The physical device index on which the DHCP server shall be
103 * executed. Must be greater than zero.
104 */
105 config Int ifIdx = 1;
106
107 /*! DhcpServer service reporting function. */
108 config dhcpServerServiceFxn pCbSrv = '&ti_ndk_config_Global_serviceReport';
109
110 /*!
111 * Causes DHCP Server to report its own IP address as the local DNS server
112 * to clients
113 */
114 config Bool localDNS = false;
115
116 /*!
117 * Causes DHCP Server to report the local domain name assigned to the
118 * virtual network to clients.
119 */
120 config Bool localDomain = false;
121 }