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 * ======== Dns ========
40 * NDK module used for creating and configuring a DNS server.
41 *
42 * The Dns module can be used to configure and create a DNS server in
43 * an NDK program.
44 *
45 * In order to configure a DNS server, users must create a Dns module
46 * parameters structure, which contains all of the instance properties of a
47 * Dns instance. Once the parameter structure is created, it may be used
48 * to change the properties of the DNS server that's being created.
49 *
50 * Users are able to create multiple DNS servers by creating multiple Dns
51 * module instances, and configuring each one. However, if multiple Dns
52 * instances are created, one must be careful to ensure that they all
53 * have been configured to have unique and free port numbers.
54 *
55 */
56
57 @Template("./Dns.xdt")
58
59 metaonly module Dns {
60
61 /*! Function signature for CISARGS struct service reporting function */
62 typedef Void (*dnsServiceFxn)(Int, Int, Int, Void *);
63
64 /*! Type used to specify bits in mode */
65 typedef Bits16 CisFlags;
66
67 /*! Specifies if the IfIdx field is valid. */
68 const CisFlags CIS_FLG_IFIDXVALID = 0x0001;
69
70 /*!
71 * Requests that IfIdx be resolved to an IP address before service
72 * execution is initiated.
73 */
74 const CisFlags CIS_FLG_RESOLVEIP = 0x0002;
75
76 /*! Specifies that the service should be invoked by IP address */
77 const CisFlags CIS_FLG_CALLBYIP = 0x0004;
78
79 /*!
80 * A service that is dependent on a valid IP address (as determined by the
81 * RESOLVEIP flag) is shut down if the IP address becomes invalid.
82 *
83 * When this flag is set, the service will be restarted when a new address
84 * becomes available. Otherwise; the service will not be restarted.
85 */
86 const CisFlags CIS_FLG_RESTARTIPTERM = 0x0008;
87
88 /*! Used to specify an external DNS Server */
89 config String externDnsServIp = null;
90
91 /*!
92 * ======== create ========
93 * Creates an Dns instance.
94 */
95 create();
96
97 instance:
98 /*!
99 * Set of flags which represent the desired behavior of the DNS Server.
100 *
101 * The following flag values may be set either individually, or by or-ing
102 * flags together:
103 * @p(blist)
104 * - CIS_FLG_IFIDXVALID - specifies if the IfIdx field is valid.
105 *
106 * - CIS_FLG_RESOLVEIP - Requests that IfIdx be resolved to an IP
107 * address before service execution is initiated.
108 *
109 * - CIS_FLG_CALLBYIP - Specifies that the service should be invoked by
110 * IP address
111 *
112 * - CIS_FLG_RESTARTIPTERM - A service that is dependent on a valid IP
113 * address.
114 * @p
115 */
116 config CisFlags mode = 0;
117
118 /*!
119 * The physical device index on which the DNS server shall be
120 * executed. Must be greater than zero.
121 */
122 config Int ifIdx = 1;
123
124 /*!
125 * The IP address on which to initiate this service.
126 *
127 * To accept a connection from any IP, specify INADDR_ANY.
128 */
129 config String ipAddr = "INADDR_ANY";
130
131 /*! Dns service reporting function. */
132 config dnsServiceFxn pCbSrv = '&ti_ndk_config_Global_serviceReport';
133
134 /*! @_nodoc
135 *
136 * internal use only. Intermediate variables mapped to Grace checkboxes,
137 * used to update 'mode' flags variable.
138 */
139 config Bool IfIdXValid = false;
140
141 /*! @_nodoc
142 *
143 * internal use only. Intermediate variables mapped to Grace checkboxes,
144 * used to update 'mode' flags variable.
145 */
146 config Bool ResolveIP = false;
147
148 /*! @_nodoc
149 *
150 * internal use only. Intermediate variables mapped to Grace checkboxes,
151 * used to update 'mode' flags variable.
152 */
153 config Bool CallByIP = false;
154
155 /*! @_nodoc
156 *
157 * internal use only. Intermediate variables mapped to Grace checkboxes,
158 * used to update 'mode' flags variable.
159 */
160 config Bool RestartIPTerm = false;
161 }