PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/389-admin-1.1.30/include/nt/nsapi.h

#
C Header | 361 lines | 264 code | 48 blank | 49 comment | 0 complexity | 0a60e4837f8e6965e1dabb383570b755 MD5 | raw file
Possible License(s): GPL-2.0, Apache-2.0
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; version 2
  9. * of the License.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. *
  20. * END COPYRIGHT BLOCK **/
  21. /*
  22. * Aruna Victor
  23. */
  24. #include <windows.h>
  25. #include <stdio.h>
  26. #include <base/buffer.h>
  27. #include <base/file.h>
  28. #include <base/daemon.h>
  29. #include <base/eventlog.h>
  30. #include <base/util.h>
  31. #include <base/shexp.h>
  32. #include <base/session.h>
  33. #include <base/sem.h>
  34. #include <base/pblock.h>
  35. #include <base/net.h>
  36. #include <base/ereport.h>
  37. #include <base/cinfo.h>
  38. #include <base/systhr.h>
  39. #include <base/shmem.h>
  40. #include <base/crit.h>
  41. #include <base/systhr.h>
  42. #include <frame/objset.h>
  43. #include <frame/conf.h>
  44. #include <frame/func.h>
  45. #include <frame/http.h>
  46. #include <frame/log.h>
  47. #include <frame/object.h>
  48. #include <frame/protocol.h>
  49. #include <frame/req.h>
  50. #include <frame/httpact.h>
  51. #include <frame/servact.h>
  52. #include <libmsgdisp/orb.h>
  53. #include <libmsgdisp/nsarray.h>
  54. #include <libmsgdisp/msgchnel.h>
  55. #include <libmsgdisp/mdbtree.h>
  56. #include <libmsgdisp/mdutil.h>
  57. #include <ssl.h>
  58. #include <nt/magnus.h>
  59. typedef void * (SafFunction)();
  60. SafFunction **SafTable;
  61. __declspec(dllexport) int InitSafTable(SafFunction *Table);
  62. /* Functions from ntbuffer.c */
  63. #define FILEBUF_OPEN 1
  64. #define NETBUF_OPEN 2
  65. #define FILEBUF_OPEN_NOSTAT 3
  66. #define PIPEBUF_OPEN 4
  67. #define PIPEBUF_CLOSE 5
  68. #define FILEBUF_NEXT 6
  69. #define NETBUF_NEXT 7
  70. #define PIPEBUF_NEXT 8
  71. #define FILEBUF_CLOSE 9
  72. #define NETBUF_CLOSE 10
  73. #define FILEBUF_GRAB 11
  74. #define NETBUF_GRAB 12
  75. #define PIPEBUF_GRAB 13
  76. #define NETBUF_BUF2SD 14
  77. #define FILEBUF_BUF2SD 15
  78. #define PIPEBUF_BUF2SD 16
  79. #define PIPEBUF_NETBUF2SD 17
  80. /* Functions from daemon.h */
  81. #define NTDAEMON_RUN 18
  82. #define CHILD_STATUS 19
  83. /* Functions from file.h */
  84. #define SYSTEM_FREAD 20
  85. #define SYSTEM_PREAD 21
  86. #define SYSTEM_FOPENRO 22
  87. #define SYSTEM_FOPENWA 23
  88. #define SYSTEM_FOPENRW 24
  89. #define SYSTEM_FCLOSE 25
  90. #define SYSTEM_NOCOREDUMPS 26
  91. #define SYSTEM_FWRITE 27
  92. #define SYSTEM_FWRITE_ATOMIC 28
  93. #define SYSTEM_WINERR 29
  94. #define SYSTEM_WINSOCKERR 30
  95. #define FILE_NOTFOUND 31
  96. #define SYSTEM_STAT 32
  97. #define SYSTEM_INITLOCK 33
  98. #define FILE_UNIX2LOCAL 34
  99. #define DIR_OPEN 35
  100. #define DIR_READ 36
  101. #define DIR_CLOSE 37
  102. /* Functions from sem.h */
  103. #define SEM_INIT 40
  104. #define SEM_TERMINATE 41
  105. #define SEM_GRAB 42
  106. #define SEM_TGRAB 43
  107. #define SEM_RELEASE 44
  108. /* Functions from session.h */
  109. #define SESSION_CREATE 45
  110. #define SESSION_FREE 46
  111. #define SESSION_DNS_LOOKUP 47
  112. /* Functions from cinfo.h */
  113. #define CINFO_INIT 70
  114. #define CINFO_TERMINATE 71
  115. #define CINFO_MERGE 72
  116. #define CINFO_FIND 73
  117. #define CINFO_LOOKUP 74
  118. #define CINFO_DUMP_DATABASE 75
  119. /* Functions from ereport.h */
  120. #define EREPORT 80
  121. #define EREPORT_INIT 81
  122. #define EREPORT_TERMINATE 82
  123. #define EREPORT_GETFD 83
  124. /* Functions from minissl.h */
  125. #define SSL_CLOSE 90
  126. #define SSL_SOCKET 91
  127. #define SSL_GET_SOCKOPT 92
  128. #define SSL_SET_SOCKOPT 93
  129. #define SSL_BIND 94
  130. #define SSL_LISTEN 95
  131. #define SSL_ACCEPT 96
  132. #define SSL_READ 97
  133. #define SSL_WRITE 98
  134. #define SSL_GETPEERNAME 99
  135. /* Functions from net.h */
  136. #define NET_BIND 110
  137. #define NET_READ 111
  138. #define NET_WRITE 112
  139. #define NET_FIND_FQDN 113
  140. #define NET_IP2HOST 114
  141. #define NET_SENDMAIL 115
  142. /* Functions from pblock.h */
  143. #define PARAM_CREATE 120
  144. #define PARAM_FREE 121
  145. #define PBLOCK_CREATE 122
  146. #define PBLOCK_FREE 123
  147. #define PBLOCK_FINDVAL 124
  148. #define PBLOCK_NVINSERT 125
  149. #define PBLOCK_NNINSERT 126
  150. #define PBLOCK_PINSERT 127
  151. #define PBLOCK_STR2PBLOCK 128
  152. #define PBLOCK_PBLOCK2STR 129
  153. #define PBLOCK_COPY 130
  154. #define PBLOCK_PB2ENV 131
  155. #define PBLOCK_FR 132
  156. /* Functions from systhr.h */
  157. #define SYSTHREAD_START 133
  158. #define SYSTHREAD_ATTACH 134
  159. #define SYSTHREAD_TERMINATE 135
  160. #define SYSTHREAD_SLEEP 136
  161. #define SYSTHREAD_INIT 137
  162. #define SYSTHREAD_NEWKEY 138
  163. #define SYSTHREAD_GETDATA 139
  164. #define SYSTHREAD_SETDATA 140
  165. /* Functions from shmem.h */
  166. #define SHMEM_ALLOC 141
  167. #define SHMEM_FREE 142
  168. /* Functions from eventlog.h */
  169. #define INITIALIZE_ADMIN_LOGGING 143
  170. #define INITIALIZE_HTTPD_LOGGING 144
  171. #define INITIALIZE_HTTPS_LOGGING 145
  172. #define TERMINATE_ADMIN_LOGGING 146
  173. #define TERMINATE_HTTPD_LOGGING 147
  174. #define TERMINATE_HTTPS_LOGGING 148
  175. #define LOG_ERROR_EVENT 149
  176. /* Functions from shexp.h */
  177. #define SHEXP_VALID 160
  178. #define SHEXP_MATCH 161
  179. #define SHEXP_CMP 162
  180. #define SHEXP_CASECMP 163
  181. /* Functions from systems.h */
  182. #define UTIL_STRCASECMP 170
  183. #define UTIL_STRNCASECMP 171
  184. /* Functions from util.h */
  185. #define UTIL_GETLINE 180
  186. #define UTIL_ENV_CREATE 181
  187. #define UTIL_ENV_STR 182
  188. #define NTUTIL_ENV_STR 183
  189. #define UTIL_ENV_REPLACE 184
  190. #define UTIL_ENV_FREE 185
  191. #define UTIL_ENV_FIND 186
  192. #define UTIL_HOSTNAME 187
  193. #define UTIL_CHDIR2PATH 188
  194. #define UTIL_IS_MOZILLA 189
  195. #define UTIL_IS_URL 190
  196. #define UTIL_LATER_THAN 191
  197. #define UTIL_URI_IS_EVIL 192
  198. #define UTIL_URI_PARSE 193
  199. #define UTIL_URI_UNESCAPE 194
  200. #define UTIL_URI_ESCAPE 195
  201. #define UTIL_URL_ESCAPE 196
  202. #define UTIL_SH_ESCAPE 197
  203. #define UTIL_ITOA 198
  204. #define UTIL_VSPRINTF 199
  205. #define UTIL_SPRINTF 200
  206. #define UTIL_VSNPRINTF 201
  207. #define UTIL_SNPRINTF 202
  208. /* Functions from magnus.h */
  209. #define MAGNUS_ATRESTART 203
  210. /* Functions from conf.h */
  211. #define CONF_INIT 207
  212. #define CONF_TERMINATE 208
  213. #define CONF_GETGLOBALS 209
  214. #define CONF_VARS2DAEMON 210
  215. /* Functions from req.h */
  216. #define REQUEST_CREATE 211
  217. #define REQUEST_FREE 212
  218. #define REQUEST_RESTART_INTERNAL 213
  219. #define REQUEST_TRANSLATE_URI 214
  220. #define REQUEST_HEADER 215
  221. #define REQUEST_STAT_PATH 216
  222. #define REQUEST_URI2PATH 217
  223. #define REQUEST_PATHCHECKS 218
  224. #define REQUEST_FILEINFO 219
  225. #define REQUEST_HANDLE_PROCESSED 220
  226. #define REQUEST_SERVICE 221
  227. #define REQUEST_HANDLE 222
  228. /* Functions from object.h */
  229. #define DIRECTIVE_NAME2NUM 223
  230. #define DIRECTIVE_NUM2NAME 224
  231. #define OBJECT_CREATE 225
  232. #define OBJECT_FREE 226
  233. #define OBJECT_ADD_DIRECTIVE 227
  234. #define OBJECT_EXECUTE 228
  235. /* Functions from objset.h */
  236. #define OBJSET_SCAN_BUFFER 230
  237. #define OBJSET_CREATE 231
  238. #define OBJSET_FREE 232
  239. #define OBJSET_FREE_SETONLY 233
  240. #define OBJSET_NEW_OBJECT 234
  241. #define OBJSET_ADD_OBJECT 235
  242. #define OBJSET_FINDBYNAME 236
  243. #define OBJSET_FINDBYPPATH 237
  244. /* Functions from http.h */
  245. #define HTTP_PARSE_REQUEST 240
  246. #define HTTP_SCAN_HEADERS 241
  247. #define HTTP_START_RESPONSE 242
  248. #define HTTP_HDRS2_ENV 243
  249. #define HTTP_STATUS 244
  250. #define HTTP_SET_FINFO 245
  251. #define HTTP_DUMP822 246
  252. #define HTTP_FINISH_REQUEST 247
  253. #define HTTP_HANDLE_SESSION 248
  254. #define HTTP_URI2URL 249
  255. /* Functions from func.h */
  256. #define FUNC_INIT 251
  257. #define FUNC_FIND 252
  258. #define FUNC_EXEC 253
  259. #define FUNC_INSERT 254
  260. /* Functions from log.h */
  261. #define LOG_ERROR 260
  262. /* robm Functions added in 2.0 */
  263. #define SYSTEM_FOPENWT 261
  264. #define SYSTEM_MALLOC 262
  265. #define SYSTEM_FREE 263
  266. #define SYSTEM_REALLOC 264
  267. #define SYSTEM_STRDUP 265
  268. #define UPLOAD_FILE 266
  269. #define CRIT_INIT 267
  270. #define CRIT_ENTER 268
  271. #define CRIT_EXIT 269
  272. #define CRIT_TERMINATE 270
  273. #define SYSTHREAD_CURRENT 271
  274. #define NET_ACCEPT 272
  275. #define NET_CLOSE 273
  276. #define NET_CONNECT 274
  277. #define NET_IOCTL 275
  278. #define NET_LISTEN 276
  279. #define NET_SETSOCKOPT 277
  280. #define NET_SOCKET 278
  281. /* Daryoush Functions added in 3.0 */
  282. #define NSORB_INIT 279
  283. #define NSORB_INST_ID 280
  284. #define NSORB_GET_INST 281
  285. #define NSORB_REG_INT 282
  286. #define NSORB_FIND_OBJ 283
  287. #define NSORB_GET_INTERFACE 284
  288. #define ARR_NEW 285
  289. #define ARR_FREE 286
  290. #define ARR_GET_OBJ 288
  291. #define ARR_GET_LAST_OBJ 289
  292. #define ARR_NEW_OBJ 290
  293. #define ARR_GET_NUM_OBJ 291
  294. #define ARR_RESET 292
  295. #define ARR_REMOVEOBJ 293
  296. #define ARR_GET_OBJ_NUM 294
  297. #define CM_BT_NEW 295
  298. #define CM_BT_ADD_NODE 296
  299. #define CM_BT_FIND_NODE 297
  300. #define CM_BT_DEL_NODE 298
  301. #define CM_BT_DESTROY 299
  302. #define CM_BT_GET_NUM 300
  303. #define CM_BT_TRAVEL 301
  304. #define CM_STR_NEW 302
  305. #define CM_STR_ADD 303
  306. #define CM_STR_REL 304
  307. #define CM_STR_FREE 305
  308. #define CM_STR_GET 306
  309. #define CM_STR_SIZE 307
  310. #define CM_COPY_STR 308
  311. #define CM_MAKE_UID 309
  312. #define MS_NEW 310
  313. #define MS_CREATE 311