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 * ======== Nat ========
39 * NDK Network Address Translation (NAT) settings and configuration.
40 *
41 */
42
43 @Template("./Nat.xdt")
44
45 metaonly module Nat {
46
47 /*! Function signature for CISARGS struct service reporting function */
48 typedef Void (*natServiceFxn)(Int, Int, Int, Void *);
49
50 /*! Type used to specify bits in mode */
51 typedef Bits16 CisFlags;
52
53 /*! Specifies if the IfIdx field is valid. */
54 const CisFlags CIS_FLG_IFIDXVALID = 0x0001;
55
56 /*!
57 * Requests that IfIdx be resolved to an IP address before service
58 * execution is initiated.
59 */
60 const CisFlags CIS_FLG_RESOLVEIP = 0x0002;
61
62 /*! Specifies that the service should be invoked by IP address */
63 const CisFlags CIS_FLG_CALLBYIP = 0x0004;
64
65 /*!
66 * A service that is dependent on a valid IP address (as determined by the
67 * RESOLVEIP flag) is shut down if the IP address becomes invalid.
68 *
69 * When this flag is set, the service will be restarted when a new address
70 * becomes available. Otherwise; the service will not be restarted.
71 */
72 const CisFlags CIS_FLG_RESTARTIPTERM = 0x0008;
73
74 /*!
75 * ======== create ========
76 * Creates an Nat instance.
77 */
78 create();
79
80 instance:
81
82 /*! Specifies the NAT group virtual network IP address. */
83 config String virtualIpAddr = null;
84
85 /*! Specifies the subnet mask of the NAT group virtual network. */
86 config String virtualMask = "255.255.254.0";
87
88 /*! Specifies the IP MTU limit (1500 for ethernet, 1492 for PPPoE, ...) */
89 config Int mtu = 1500;
90
91 /*!
92 * Set of flags which represent the desired behavior of the telnet Server.
93 *
94 * The following flag values may be set either individually, or by or-ing
95 * flags together:
96 * @p(blist)
97 * - CIS_FLG_IFIDXVALID - specifies if the IfIdx field is valid.
98 *
99 * - CIS_FLG_RESOLVEIP - Requests that IfIdx be resolved to an IP
100 * address before service execution is initiated.
101 *
102 * - CIS_FLG_CALLBYIP - Specifies that the service should be invoked by
103 * IP address
104 *
105 * - CIS_FLG_RESTARTIPTERM - A service that is dependent on a valid IP
106 * address.
107 * @p
108 */
109 config Int mode = 0;
110
111 /*!
112 * The physical device index on which the NAT server shall be
113 * executed. Must be greater than zero.
114 */
115 config Int ifIdx = 1;
116
117 /*! Nat service reporting function. */
118 config natServiceFxn pCbSrv = "&ti_ndk_config_Global_serviceReport";
119
120 /*! @_nodoc
121 *
122 * internal use only. Intermediate variables mapped to Grace checkboxes,
123 * used to update 'mode' flags variable.
124 */
125 config Bool IfIdXValid = false;
126
127 /*! @_nodoc
128 *
129 * internal use only. Intermediate variables mapped to Grace checkboxes,
130 * used to update 'mode' flags variable.
131 */
132 config Bool ResolveIP = false;
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 CallByIP = 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 RestartIPTerm = false;
147 }