1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** NetX Component                                                        */
17 /**                                                                       */
18 /**   Hypertext Transfer Protocol (HTTP)                                  */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /**************************************************************************/
25 /*                                                                        */
26 /*  APPLICATION INTERFACE DEFINITION                       RELEASE        */
27 /*                                                                        */
28 /*    nxd_http_server.h                                   PORTABLE C      */
29 /*                                                           6.2.0        */
30 /*  AUTHOR                                                                */
31 /*                                                                        */
32 /*    Yuxin Zhou, Microsoft Corporation                                   */
33 /*                                                                        */
34 /*  DESCRIPTION                                                           */
35 /*                                                                        */
36 /*    This file defines the NetX Hypertext Transfer Protocol (HTTP)       */
37 /*    component, including all data types and external references.        */
38 /*    It is assumed that nx_api.h and nx_port.h have already been         */
39 /*    included, along with fx_api.h and fx_port.h.                        */
40 /*                                                                        */
41 /*  RELEASE HISTORY                                                       */
42 /*                                                                        */
43 /*    DATE              NAME                      DESCRIPTION             */
44 /*                                                                        */
45 /*  05-19-2020     Yuxin Zhou               Initial Version 6.0           */
46 /*  09-30-2020     Yuxin Zhou               Modified comment(s),          */
47 /*                                            resulting in version 6.1    */
48 /*  04-02-2021     Yuxin Zhou               Modified comment(s), and      */
49 /*                                            improved the logic of       */
50 /*                                            parsing base64,             */
51 /*                                            resulting in version 6.1.6  */
52 /*  08-02-2021     Yuxin Zhou               Modified comment(s), and      */
53 /*                                            improved the logic of       */
54 /*                                            converting number to string,*/
55 /*                                            resulting in version 6.1.8  */
56 /*  10-31-2022     Yuxin Zhou               Modified comment(s), and      */
57 /*                                            supported random nonce,     */
58 /*                                            resulting in version 6.2.0  */
59 /*                                                                        */
60 /*                                                                        */
61 /**************************************************************************/
62 
63 #ifndef NXD_HTTP_SERVER_H
64 #define NXD_HTTP_SERVER_H
65 
66 /* Determine if a C++ compiler is being used.  If so, ensure that standard
67    C is used to process the API information.  */
68 
69 #ifdef   __cplusplus
70 
71 /* Yes, C++ compiler is present.  Use standard C.  */
72 extern   "C" {
73 
74 #endif
75 
76 #include    "nx_api.h"
77 /* If not using FileX, define this option and define the file writing services
78    declared in filex_stub.h.  */
79 /* #define      NX_HTTP_NO_FILEX  */
80 
81 #ifndef      NX_HTTP_NO_FILEX
82 #include    "fx_api.h"
83 #else
84 #include    "filex_stub.h"
85 #endif
86 
87 /* Define the HTTP Server ID.  */
88 
89 #define NXD_HTTP_SERVER_ID                  0x48545451UL
90 
91 
92 /* Define the HTTP version.  */
93 #define NX_HTTP_VERSION                     "HTTP/1.0"
94 
95 /* Enable Digest authentication.
96 #define NX_HTTP_DIGEST_ENABLE
97 */
98 
99 /* Define HTTP TCP socket create options.  */
100 
101 #ifndef NX_HTTP_TYPE_OF_SERVICE
102 #define NX_HTTP_TYPE_OF_SERVICE             NX_IP_NORMAL
103 #endif
104 
105 #ifndef NX_HTTP_FRAGMENT_OPTION
106 #define NX_HTTP_FRAGMENT_OPTION             NX_DONT_FRAGMENT
107 #endif
108 
109 #ifndef NX_HTTP_TIME_TO_LIVE
110 #define NX_HTTP_TIME_TO_LIVE                0x80
111 #endif
112 
113 #ifndef NX_HTTP_SERVER_PRIORITY
114 #define NX_HTTP_SERVER_PRIORITY             16
115 #endif
116 
117 #ifndef NX_HTTP_SERVER_WINDOW_SIZE
118 #define NX_HTTP_SERVER_WINDOW_SIZE          2048
119 #endif
120 
121 #ifndef NX_HTTP_SERVER_TIMEOUT_ACCEPT
122 #define NX_HTTP_SERVER_TIMEOUT_ACCEPT       (10 * NX_IP_PERIODIC_RATE)
123 #endif
124 
125 #ifndef NX_HTTP_SERVER_TIMEOUT_RECEIVE
126 #define NX_HTTP_SERVER_TIMEOUT_RECEIVE      (10 * NX_IP_PERIODIC_RATE)
127 #endif
128 
129 #ifndef NX_HTTP_SERVER_TIMEOUT_SEND
130 #define NX_HTTP_SERVER_TIMEOUT_SEND         (10 * NX_IP_PERIODIC_RATE)
131 #endif
132 
133 #ifndef NX_HTTP_SERVER_TIMEOUT_DISCONNECT
134 #define NX_HTTP_SERVER_TIMEOUT_DISCONNECT   (10 * NX_IP_PERIODIC_RATE)
135 #endif
136 
137 #ifndef NX_HTTP_SERVER_TIMEOUT
138 #define NX_HTTP_SERVER_TIMEOUT              (10 * NX_IP_PERIODIC_RATE)
139 #endif
140 
141 #ifndef NX_HTTP_SERVER_MAX_PENDING
142 #define NX_HTTP_SERVER_MAX_PENDING          5
143 #endif
144 
145 #ifndef NX_HTTP_SERVER_THREAD_TIME_SLICE
146 #define NX_HTTP_SERVER_THREAD_TIME_SLICE    2
147 #endif
148 
149 #ifndef NX_HTTP_MAX_RESOURCE
150 #define NX_HTTP_MAX_RESOURCE                40
151 #endif
152 
153 #ifndef NX_HTTP_MAX_NAME
154 #define NX_HTTP_MAX_NAME                    20
155 #endif
156 
157 #ifndef NX_HTTP_MAX_PASSWORD
158 #define NX_HTTP_MAX_PASSWORD                20
159 #endif
160 
161 #ifndef NX_PHYSICAL_TRAILER
162 #define NX_PHYSICAL_TRAILER                 4
163 #endif
164 
165 #ifndef NX_HTTP_SERVER_MIN_PACKET_SIZE
166 #define NX_HTTP_SERVER_MIN_PACKET_SIZE      600
167 #endif
168 
169 /* Define the HTTP server retry parameters.  */
170 
171 #ifndef NX_HTTP_SERVER_RETRY_SECONDS
172 #define NX_HTTP_SERVER_RETRY_SECONDS        2           /* 2 second initial timeout                            */
173 #endif
174 
175 #ifndef NX_HTTP_SERVER_TRANSMIT_QUEUE_DEPTH
176 #define NX_HTTP_SERVER_TRANSMIT_QUEUE_DEPTH 20          /* Maximum of 20 queued transmit packets               */
177 #endif
178 
179 #ifndef NX_HTTP_SERVER_RETRY_MAX
180 #define NX_HTTP_SERVER_RETRY_MAX            10          /* Maximum of 10 retries per packet                    */
181 #endif
182 
183 #ifndef NX_HTTP_SERVER_RETRY_SHIFT
184 #define NX_HTTP_SERVER_RETRY_SHIFT          1           /* Every retry is twice as long                        */
185 #endif
186 
187 #ifndef NX_HTTP_SERVER_NONCE_SIZE
188 #define NX_HTTP_SERVER_NONCE_SIZE           32          /* The size of nonce for digest authtentication        */
189 #endif
190 
191 #ifndef NX_HTTP_SERVER_NONCE_MAX
192 #define NX_HTTP_SERVER_NONCE_MAX            2           /* The size of nonce for digest authtentication        */
193 #endif
194 
195 #ifndef NX_HTTP_SERVER_NONCE_TIMEOUT
196 #define NX_HTTP_SERVER_NONCE_TIMEOUT        (10 * NX_IP_PERIODIC_RATE)
197 #endif
198 
199 /* Define the state of the nonce.  */
200 
201 #define NX_HTTP_SERVER_NONCE_INVALID        0
202 #define NX_HTTP_SERVER_NONCE_VALID          1
203 #define NX_HTTP_SERVER_NONCE_ACCEPTED       2
204 
205 /* NX_HTTP_MAX_STRING is base64 of "name:password" and plus 1 if an extra conversion is needed and plus 2 pad if needed. */
206 #define NX_HTTP_MAX_STRING                  ((NX_HTTP_MAX_NAME + NX_HTTP_MAX_PASSWORD + 1) * 4 / 3 + 1 + 2)
207 
208 #define NX_HTTP_MAX_BINARY_MD5              16
209 #define NX_HTTP_MAX_ASCII_MD5               32
210 
211 
212 /* Define HTTP Server request types.  */
213 
214 #define NX_HTTP_SERVER_UNKNOWN_REQUEST      0
215 #define NX_HTTP_SERVER_GET_REQUEST          1
216 #define NX_HTTP_SERVER_POST_REQUEST         2
217 #define NX_HTTP_SERVER_HEAD_REQUEST         3
218 #define NX_HTTP_SERVER_PUT_REQUEST          4
219 #define NX_HTTP_SERVER_DELETE_REQUEST       5
220 
221 
222 /* Define return code constants.  */
223 
224 #define NX_HTTP_ERROR                       0xE0        /* HTTP internal error                                  */
225 #define NX_HTTP_TIMEOUT                     0xE1        /* HTTP timeout occurred                                */
226 #define NX_HTTP_FAILED                      0xE2        /* HTTP error                                           */
227 #define NX_HTTP_DONT_AUTHENTICATE           0xE3        /* HTTP authentication not needed                       */
228 #define NX_HTTP_BASIC_AUTHENTICATE          0xE4        /* HTTP basic authentication requested                  */
229 #define NX_HTTP_DIGEST_AUTHENTICATE         0xE5        /* HTTP digest authentication requested                 */
230 #define NX_HTTP_NOT_FOUND                   0xE6        /* HTTP request not found                               */
231 #define NX_HTTP_DATA_END                    0xE7        /* HTTP end of content area                             */
232 #define NX_HTTP_CALLBACK_COMPLETED          0xE8        /* HTTP user callback completed the processing          */
233 #define NX_HTTP_POOL_ERROR                  0xE9        /* HTTP supplied pool payload is too small              */
234 #define NX_HTTP_NOT_READY                   0xEA        /* HTTP client not ready for operation                  */
235 #define NX_HTTP_AUTHENTICATION_ERROR        0xEB        /* HTTP client authentication failed                    */
236 #define NX_HTTP_GET_DONE                    0xEC        /* HTTP client get is complete                          */
237 #define NX_HTTP_BAD_PACKET_LENGTH           0xED        /* Invalid packet received - length incorrect           */
238 #define NX_HTTP_REQUEST_UNSUCCESSFUL_CODE   0xEE        /* Received an error code instead of 2xx from server    */
239 #define NX_HTTP_INCOMPLETE_PUT_ERROR        0xEF        /* Server responds before PUT is complete               */
240 #define NX_HTTP_PASSWORD_TOO_LONG           0xF0        /* Password exceeded expected length                    */
241 #define NX_HTTP_USERNAME_TOO_LONG           0xF1        /* Username exceeded expected length                    */
242 #define NX_HTTP_NO_QUERY_PARSED             0xF2        /* Server unable to find query in client request        */
243 #define NX_HTTP_IMPROPERLY_TERMINATED_PARAM 0xF3        /* Client request parameter not properly terminated     */
244 #define NX_HTTP_BOUNDARY_ALREADY_FOUND      0xF4        /* Boundary is already found.                           */
245 
246 /* Define the HTTP Server TCP port number */
247 
248 #define NX_HTTP_SERVER_PORT                 80          /* Port for HTTP server                                 */
249 
250 #ifdef  NX_HTTP_DIGEST_ENABLE
251 
252 /* Include the MD5 digest header file.  */
253 
254 #include "nx_md5.h"
255 
256 #endif
257 
258 /* Define the status code. */
259 
260 #define NX_HTTP_STATUS_CONTINUE             "100 Continue"
261 #define NX_HTTP_STATUS_SWITCHING_PROTOCOLS  "101 Switching Protocols"
262 #define NX_HTTP_STATUS_OK                   "200 OK"
263 #define NX_HTTP_STATUS_CREATED              "201 Created"
264 #define NX_HTTP_STATUS_ACCEPTED             "202 Accepted"
265 #define NX_HTTP_STATUS_NON_AUTH_INFO        "203 Non-Authoritative Information"
266 #define NX_HTTP_STATUS_NO_CONTENT           "204 No Content"
267 #define NX_HTTP_STATUS_RESET_CONTENT        "205 Reset Content"
268 #define NX_HTTP_STATUS_PARTIAL_CONTENT      "206 Partial Content"
269 #define NX_HTTP_STATUS_MULTIPLE_CHOICES     "300 Multiple Choices"
270 #define NX_HTTP_STATUS_MOVED_PERMANETLY     "301 Moved Permanently"
271 #define NX_HTTP_STATUS_FOUND                "302 Found"
272 #define NX_HTTP_STATUS_SEE_OTHER            "303 See Other"
273 #define NX_HTTP_STATUS_NOT_MODIFIED         "304 Not Modified"
274 #define NX_HTTP_STATUS_USE_PROXY            "305 Use Proxy"
275 #define NX_HTTP_STATUS_TEMPORARY_REDIRECT   "307 Temporary Redirect"
276 #define NX_HTTP_STATUS_BAD_REQUEST          "400 Bad Request"
277 #define NX_HTTP_STATUS_UNAUTHORIZED         "401 Unauthorized"
278 #define NX_HTTP_STATUS_PAYMENT_REQUIRED     "402 Payment Required"
279 #define NX_HTTP_STATUS_FORBIDDEN            "403 Forbidden"
280 #define NX_HTTP_STATUS_NOT_FOUND            "404 Not Found"
281 #define NX_HTTP_STATUS_METHOD_NOT_ALLOWED   "405 Method Not Allowed"
282 #define NX_HTTP_STATUS_NOT_ACCEPTABLE       "406 Not Acceptable"
283 #define NX_HTTP_STATUS_PROXY_AUTH_REQUIRED  "407 Proxy Authentication Required"
284 #define NX_HTTP_STATUS_REQUEST_TIMEOUT      "408 Request Time-out"
285 #define NX_HTTP_STATUS_CONFLICT             "409 Conflict"
286 #define NX_HTTP_STATUS_GONE                 "410 Gone"
287 #define NX_HTTP_STATUS_LENGTH_REQUIRED      "411 Length Required"
288 #define NX_HTTP_STATUS_PRECONDITION_FAILED  "412 Precondition Failed"
289 #define NX_HTTP_STATUS_ENTITY_TOO_LARGE     "413 Request Entity Too Large"
290 #define NX_HTTP_STATUS_URL_TOO_LARGE        "414 Request-URL Too Large"
291 #define NX_HTTP_STATUS_UNSUPPORTED_MEDIA    "415 Unsupported Media Type"
292 #define NX_HTTP_STATUS_RANGE_NOT_SATISFY    "416 Requested range not satisfiable"
293 #define NX_HTTP_STATUS_EXPECTATION_FAILED   "417 Expectation Failed"
294 #define NX_HTTP_STATUS_INTERNAL_ERROR       "500 Internal Server Error"
295 #define NX_HTTP_STATUS_NOT_IMPLEMENTED      "501 Not Implemented"
296 #define NX_HTTP_STATUS_BAD_GATEWAY          "502 Bad Gateway"
297 #define NX_HTTP_STATUS_SERVICE_UNAVAILABLE  "503 Service Unavailable"
298 #define NX_HTTP_STATUS_GATEWAY_TIMEOUT      "504 Gateway Time-out"
299 #define NX_HTTP_STATUS_VERSION_ERROR        "505 HTTP Version not supported"
300 
301 
302 /* Define the max length of header field. */
303 
304 #ifndef NX_HTTP_MAX_HEADER_FIELD
305 #define NX_HTTP_MAX_HEADER_FIELD            256
306 #endif
307 
308 
309 /* Define default MIME type. */
310 /* Page 14, Section 5.2, RFC 2045 */
311 #define NX_HTTP_SERVER_DEFAULT_MIME         "text/plain"
312 
313 
314 /* Define the MIME map structure. */
315 
316 typedef struct NX_HTTP_SERVER_MIME_MAP_STRUCT
317 {
318     CHAR           *nx_http_server_mime_map_extension;              /* Extension of file    */
319     CHAR           *nx_http_server_mime_map_type;                   /* MIME type of file    */
320 } NX_HTTP_SERVER_MIME_MAP;
321 
322 
323 /* Define the date structure. */
324 
325 typedef struct NX_HTTP_SERVER_DATE_STRUCT
326 {
327     USHORT          nx_http_server_year;                            /* Year                 */
328     UCHAR           nx_http_server_month;                           /* Month                */
329     UCHAR           nx_http_server_day;                             /* Day                  */
330     UCHAR           nx_http_server_hour;                            /* Hour                 */
331     UCHAR           nx_http_server_minute;                          /* Minute               */
332     UCHAR           nx_http_server_second;                          /* Second               */
333     UCHAR           nx_http_server_weekday;                         /* Weekday              */
334 } NX_HTTP_SERVER_DATE;
335 
336 
337 /* Define the nonce structure.  */
338 
339 typedef struct NX_HTTP_SERVER_NONCE_STRUCT
340 {
341     UINT            nonce_state;                                    /* The state of the nonce               */
342     UINT            nonce_timestamp;                                /* The time when the nonce is created   */
343     UCHAR           nonce_buffer[NX_HTTP_SERVER_NONCE_SIZE];        /* Nonce for digest authetication       */
344 } NX_HTTP_SERVER_NONCE;
345 
346 
347 /* Define the multipart context data structure.  */
348 
349 typedef struct NX_HTTP_SERVER_MULTIPART_STRUCT
350 {
351 
352     /* Boundary string.  */
353     UCHAR           nx_http_server_multipart_boundary[NX_HTTP_MAX_HEADER_FIELD + 1];
354 
355     /* Offset of available data. */
356     UINT            nx_http_server_multipart_available_offset;
357 
358     /* Length of available data. */
359     UINT            nx_http_server_multipart_available_length;
360 
361     /* Boundary find status. */
362     volatile UINT   nx_http_server_multipart_boundary_find;
363 
364     /* The next packet to process. */
365     NX_PACKET      *nx_http_server_multipart_next_packet;
366 
367     /* Offset of next available data. */
368     UINT            nx_http_server_multipart_next_available_offset;
369 
370     /* The packet returned at last. */
371     NX_PACKET      *nx_http_server_multipart_last_packet;
372 
373 } NX_HTTP_SERVER_MULTIPART;
374 
375 
376 /* Define the HTTP Server data structure.  */
377 
378 typedef struct NX_HTTP_SERVER_STRUCT
379 {
380     ULONG           nx_http_server_id;                              /* HTTP Server ID                       */
381     CHAR           *nx_http_server_name;                            /* Name of this HTTP Server             */
382     NX_IP          *nx_http_server_ip_ptr;                          /* Pointer to associated IP structure   */
383     CHAR            nx_http_server_request_resource[NX_HTTP_MAX_RESOURCE + 1];
384                                                                     /* Uniform Resource Locator (URL)       */
385     UINT            nx_http_connection_pending;                     /* Connection pending flag              */
386     NX_PACKET_POOL *nx_http_server_packet_pool_ptr;                 /* Pointer to HTTP Server packet pool   */
387     FX_MEDIA       *nx_http_server_media_ptr;                       /* Pointer to media control block       */
388     ULONG           nx_http_server_get_requests;                    /* Number of get requests               */
389     ULONG           nx_http_server_head_requests;                   /* Number of head requests              */
390     ULONG           nx_http_server_put_requests;                    /* Number of put requests               */
391     ULONG           nx_http_server_delete_requests;                 /* Number of delete requests            */
392     ULONG           nx_http_server_post_requests;                   /* Number of post requests              */
393     ULONG           nx_http_server_unknown_requests;                /* Number of unknown requests           */
394     ULONG           nx_http_server_total_bytes_sent;                /* Number of total bytes sent           */
395     ULONG           nx_http_server_total_bytes_received;            /* Number of total bytes received       */
396     ULONG           nx_http_server_allocation_errors;               /* Number of allocation errors          */
397     ULONG           nx_http_server_connection_failures;             /* Number of failed connections         */
398     ULONG           nx_http_server_connection_successes;            /* Number of successful connections     */
399     ULONG           nx_http_server_invalid_http_headers;            /* Number of invalid http headers       */
400     FX_FILE         nx_http_server_file;                            /* HTTP file control block              */
401     NX_TCP_SOCKET   nx_http_server_socket;                          /* HTTP Server TCP socket               */
402     TX_THREAD       nx_http_server_thread;                          /* HTTP server thread                   */
403 #ifdef  NX_HTTP_DIGEST_ENABLE
404     NX_MD5          nx_http_server_md5data;                         /* HTTP server MD5 work area            */
405     NX_HTTP_SERVER_NONCE
406                     nx_http_server_nonces[NX_HTTP_SERVER_NONCE_MAX];/* Nonce for digest authetication       */
407 #endif /* NX_HTTP_DIGEST_ENABLE */
408 
409 #ifdef  NX_HTTP_MULTIPART_ENABLE
410     NX_HTTP_SERVER_MULTIPART
411                     nx_http_server_multipart;                       /* HTTP multipart area                  */
412 #endif /* NX_HTTP_MULTIPART_ENABLE */
413 
414     UINT            nx_http_server_request_type;                    /* HTTP request type                    */
415     NX_HTTP_SERVER_MIME_MAP
416                    *nx_http_server_mime_maps_additional;            /* Additional HTTP MIME maps            */
417     UINT            nx_http_server_mime_maps_additional_num;        /* Number of additional HTTP MIME maps  */
418     /* Define the user supplied routines that are used to inform the application of particular server requests.  */
419 
420     UINT (*nx_http_server_authentication_check)(struct NX_HTTP_SERVER_STRUCT *server_ptr, UINT request_type, CHAR *resource, CHAR **name, CHAR **password, CHAR **realm);
421     UINT (*nx_http_server_authentication_check_extended)(struct NX_HTTP_SERVER_STRUCT *server_ptr, UINT request_type, CHAR *resource, CHAR **name, UINT *name_length, CHAR **password, UINT *password_length, CHAR **realm, UINT *realm_length);
422     UINT (*nx_http_server_request_notify)(struct NX_HTTP_SERVER_STRUCT *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr);
423     UINT (*nx_http_server_invalid_username_password_callback)(CHAR *resource, NXD_ADDRESS *client_nxd_address, UINT request_type);
424     VOID (*nx_http_server_gmt_get)(NX_HTTP_SERVER_DATE *date);
425     UINT (*nx_http_server_cache_info_get)(CHAR *resource, UINT *max_age, NX_HTTP_SERVER_DATE *last_modified);
426 #ifdef  NX_HTTP_DIGEST_ENABLE
427     UINT (*nx_http_server_digest_authenticate_callback)(struct NX_HTTP_SERVER_STRUCT *server_ptr, CHAR *name_ptr,
428                                                         CHAR *realm_ptr, CHAR *password_ptr, CHAR *method,
429                                                         CHAR *authorization_uri, CHAR *authorization_nc,
430                                                         CHAR *authorization_cnonce);
431 #endif
432 } NX_HTTP_SERVER;
433 
434 
435 #ifndef NX_HTTP_SOURCE_CODE
436 
437 /* Application caller is present, perform API mapping.  */
438 
439 /* Determine if error checking is desired.  If so, map API functions
440    to the appropriate error checking front-ends.  Otherwise, map API
441    functions to the core functions that actually perform the work.
442    Note: error checking is enabled by default.  */
443 
444 #ifdef NX_DISABLE_ERROR_CHECKING
445 
446 /* Services without error checking.  */
447 
448 #define nx_http_server_callback_data_send           _nx_http_server_callback_data_send
449 #define nx_http_server_callback_response_send       _nx_http_server_callback_response_send
450 #define nx_http_server_callback_response_send_extended _nx_http_server_callback_response_send_extended
451 #define nx_http_server_content_get                  _nx_http_server_content_get
452 #define nx_http_server_content_length_get           _nx_http_server_content_length_get
453 #define nx_http_server_create                       _nx_http_server_create
454 #define nx_http_server_delete                       _nx_http_server_delete
455 #define nx_http_server_param_get                    _nx_http_server_param_get
456 #define nx_http_server_query_get                    _nx_http_server_query_get
457 #define nx_http_server_start                        _nx_http_server_start
458 #define nx_http_server_stop                         _nx_http_server_stop
459 #define nx_http_server_content_get_extended         _nx_http_server_content_get_extended
460 #define nx_http_server_content_length_get_extended  _nx_http_server_content_length_get_extended
461 #define nx_http_server_get_entity_header            _nx_http_server_get_entity_header
462 #define nx_http_server_get_entity_content           _nx_http_server_get_entity_content
463 #define nx_http_server_callback_generate_response_header _nx_http_server_callback_generate_response_header
464 #define nx_http_server_callback_generate_response_header_extended _nx_http_server_callback_generate_response_header_extended
465 #define nx_http_server_callback_packet_send         _nx_http_server_callback_packet_send
466 #define nx_http_server_gmt_callback_set             _nx_http_server_gmt_callback_set
467 #define nx_http_server_cache_info_callback_set      _nx_http_server_cache_info_callback_set
468 #define nx_http_server_mime_maps_additional_set     _nx_http_server_mime_maps_additional_set
469 #define nx_http_server_type_get                     _nx_http_server_type_get
470 #define nx_http_server_type_get_extended            _nx_http_server_type_get_extended
471 #define nx_http_server_packet_content_find          _nx_http_server_packet_content_find
472 #define nx_http_server_packet_get                   _nx_http_server_packet_get
473 #define nx_http_server_invalid_userpassword_notify_set _nx_http_server_invalid_userpassword_notify_set
474 #define nx_http_server_digest_authenticate_notify_set _nx_http_server_digest_authenticate_notify_set
475 #define nx_http_server_authentication_check_set      _nx_http_server_authentication_check_set
476 
477 #else
478 
479 /* Services with error checking.  */
480 
481 #define nx_http_server_callback_data_send           _nxe_http_server_callback_data_send
482 #define nx_http_server_callback_response_send       _nxe_http_server_callback_response_send
483 #define nx_http_server_callback_response_send_extended _nxe_http_server_callback_response_send_extended
484 #define nx_http_server_content_get                  _nxe_http_server_content_get
485 #define nx_http_server_content_length_get           _nxe_http_server_content_length_get
486 #define nx_http_server_create(p,n,i,m,sp,ss,pp,a,r) _nxe_http_server_create(p,n,i,m,sp,ss,pp,a,r,sizeof(NX_HTTP_SERVER))
487 #define nx_http_server_delete                       _nxe_http_server_delete
488 #define nx_http_server_param_get                    _nxe_http_server_param_get
489 #define nx_http_server_query_get                    _nxe_http_server_query_get
490 #define nx_http_server_start                        _nxe_http_server_start
491 #define nx_http_server_stop                         _nxe_http_server_stop
492 #define nx_http_server_content_get_extended         _nxe_http_server_content_get_extended
493 #define nx_http_server_content_length_get_extended  _nxe_http_server_content_length_get_extended
494 #define nx_http_server_get_entity_header            _nxe_http_server_get_entity_header
495 #define nx_http_server_get_entity_content           _nxe_http_server_get_entity_content
496 #define nx_http_server_callback_generate_response_header _nxe_http_server_callback_generate_response_header
497 #define nx_http_server_callback_generate_response_header_extended _nxe_http_server_callback_generate_response_header_extended
498 #define nx_http_server_callback_packet_send         _nxe_http_server_callback_packet_send
499 #define nx_http_server_gmt_callback_set             _nxe_http_server_gmt_callback_set
500 #define nx_http_server_cache_info_callback_set      _nxe_http_server_cache_info_callback_set
501 #define nx_http_server_mime_maps_additional_set     _nxe_http_server_mime_maps_additional_set
502 #define nx_http_server_type_get                     _nxe_http_server_type_get
503 #define nx_http_server_type_get_extended            _nxe_http_server_type_get_extended
504 #define nx_http_server_packet_content_find          _nxe_http_server_packet_content_find
505 #define nx_http_server_packet_get                   _nxe_http_server_packet_get
506 #define nx_http_server_invalid_userpassword_notify_set _nxe_http_server_invalid_userpassword_notify_set
507 #define nx_http_server_digest_authenticate_notify_set _nxe_http_server_digest_authenticate_notify_set
508 #define nx_http_server_authentication_check_set      _nxe_http_server_authentication_check_set
509 
510 #endif
511 
512 /* Define the prototypes accessible to the application software.  */
513 
514 
515 UINT        nx_http_server_callback_data_send(NX_HTTP_SERVER *server_ptr, VOID *data_ptr, ULONG data_length);
516 UINT        nx_http_server_callback_response_send(NX_HTTP_SERVER *server_ptr, CHAR *status_code, CHAR *information, CHAR *additional_info);
517 UINT        nx_http_server_callback_response_send_extended(NX_HTTP_SERVER *server_ptr, CHAR *status_code, UINT status_code_length, CHAR *information, UINT information_length, CHAR *additional_info, UINT additional_info_length);
518 UINT        nx_http_server_content_get(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr, ULONG byte_offset, CHAR *destination_ptr, UINT destination_size, UINT *actual_size);
519 UINT        nx_http_server_packet_get(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_ptr);
520 UINT        nx_http_server_packet_content_find(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_ptr, ULONG *content_length);
521 UINT        nx_http_server_content_length_get(NX_PACKET *packet_ptr);
522 #ifdef NX_DISABLE_ERROR_CHECKING
523 UINT        _nx_http_server_create(NX_HTTP_SERVER *http_server_ptr, CHAR *http_server_name, NX_IP *ip_ptr, FX_MEDIA *media_ptr, VOID *stack_ptr, ULONG stack_size, NX_PACKET_POOL *pool_ptr,
524                                    UINT (*authentication_check)(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, CHAR **password, CHAR **realm),
525                                    UINT (*request_notify)(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr));
526 #else
527 UINT        _nxe_http_server_create(NX_HTTP_SERVER *http_server_ptr, CHAR *http_server_name, NX_IP *ip_ptr, FX_MEDIA *media_ptr, VOID *stack_ptr, ULONG stack_size, NX_PACKET_POOL *pool_ptr,
528                                     UINT (*authentication_check)(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, CHAR **password, CHAR **realm),
529                                     UINT (*request_notify)(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr),
530                                     UINT http_server_size);
531 #endif /* NX_DISABLE_ERROR_CHECKING */
532 UINT        nx_http_server_delete(NX_HTTP_SERVER *http_server_ptr);
533 UINT        nx_http_server_param_get(NX_PACKET *packet_ptr, UINT param_number, CHAR *param_ptr, UINT max_param_size);
534 UINT        nx_http_server_query_get(NX_PACKET *packet_ptr, UINT query_number, CHAR *query_ptr, UINT max_query_size);
535 UINT        nx_http_server_start(NX_HTTP_SERVER *http_server_ptr);
536 UINT        nx_http_server_stop(NX_HTTP_SERVER *http_server_ptr);
537 UINT        nx_http_server_content_get_extended(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr, ULONG byte_offset, CHAR *destination_ptr, UINT destination_size, UINT *actual_size);
538 UINT        nx_http_server_content_length_get_extended(NX_PACKET *packet_ptr, ULONG *length);
539 UINT        nx_http_server_get_entity_header(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr, UCHAR *entity_header_buffer, ULONG buffer_size);
540 UINT        nx_http_server_get_entity_content(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr, ULONG *available_offset, ULONG *available_length);
541 UINT        nx_http_server_callback_generate_response_header(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr,
542                                                              CHAR *status_code, UINT content_length, CHAR *content_type,
543                                                              CHAR* additional_header);
544 UINT        nx_http_server_callback_generate_response_header_extended(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr, CHAR *status_code,
545                                                                       UINT status_code_length, UINT content_length, CHAR *content_type,
546                                                                       UINT content_type_length, CHAR* additional_header, UINT additional_header_length);
547 UINT        nx_http_server_callback_packet_send(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr);
548 UINT        nx_http_server_gmt_callback_set(NX_HTTP_SERVER *server_ptr, VOID (*gmt_get)(NX_HTTP_SERVER_DATE *));
549 UINT        nx_http_server_cache_info_callback_set(NX_HTTP_SERVER *server_ptr, UINT (*cache_info_get)(CHAR *, UINT *, NX_HTTP_SERVER_DATE *));
550 UINT        nx_http_server_mime_maps_additional_set(NX_HTTP_SERVER *server_ptr, NX_HTTP_SERVER_MIME_MAP *mime_maps, UINT mime_maps_num);
551 UINT        nx_http_server_type_get(NX_HTTP_SERVER *server_ptr, CHAR *name, CHAR *http_type_string);
552 UINT        nx_http_server_type_get_extended(NX_HTTP_SERVER *server_ptr, CHAR *name, UINT name_length, CHAR *http_type_string, UINT http_type_string_max_size);
553 UINT        nx_http_server_invalid_userpassword_notify_set(NX_HTTP_SERVER *http_server_ptr, UINT (*invalid_username_password_callback)(CHAR *resource, NXD_ADDRESS *client_nxd_address, UINT request_type ));
554 UINT        nx_http_server_digest_authenticate_notify_set(NX_HTTP_SERVER *http_server_ptr,
555                                                           UINT (*digest_authenticate_callback)(NX_HTTP_SERVER *server_ptr, CHAR *name_ptr,
556                                                           CHAR *realm_ptr, CHAR *password_ptr, CHAR *method,
557                                                           CHAR *authorization_uri, CHAR *authorization_nc,
558                                                           CHAR *authorization_cnonce));
559 UINT        nx_http_server_authentication_check_set(NX_HTTP_SERVER *http_server_ptr,
560                                                     UINT (*authentication_check_extended)(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, UINT *name_length, CHAR **password, UINT *password_length, CHAR **realm, UINT *realm_length));
561 
562 #else
563 
564 /* HTTP source code is being compiled, do not perform any API mapping.  */
565 
566 UINT        _nx_http_server_callback_data_send(NX_HTTP_SERVER *server_ptr, VOID *data_ptr, ULONG data_length);
567 UINT        _nx_http_server_callback_response_send(NX_HTTP_SERVER *server_ptr, CHAR *status_code, CHAR *information, CHAR *additional_info);
568 UINT        _nx_http_server_callback_response_send_extended(NX_HTTP_SERVER *server_ptr, CHAR *status_code, UINT status_code_length, CHAR *information, UINT infomation_length, CHAR *additional_info, UINT additional_info_length);
569 UINT        _nx_http_server_content_get(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr, ULONG byte_offset, CHAR *destination_ptr, UINT destination_size, UINT *actual_size);
570 UINT        _nx_http_server_content_length_get(NX_PACKET *packet_ptr);
571 UINT        _nx_http_server_create(NX_HTTP_SERVER *http_server_ptr, CHAR *http_server_name, NX_IP *ip_ptr, FX_MEDIA *media_ptr, VOID *stack_ptr, ULONG stack_size, NX_PACKET_POOL *pool_ptr,
572                                 UINT (*authentication_check)(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, CHAR **password, CHAR **realm),
573                                 UINT (*request_notify)(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr));
574 UINT        _nx_http_server_delete(NX_HTTP_SERVER *http_server_ptr);
575 UINT        _nx_http_server_param_get(NX_PACKET *packet_ptr, UINT param_number, CHAR *param_ptr, UINT max_param_size);
576 UINT        _nx_http_server_query_get(NX_PACKET *packet_ptr, UINT query_number, CHAR *query_ptr, UINT max_query_size);
577 UINT        _nx_http_server_start(NX_HTTP_SERVER *http_server_ptr);
578 UINT        _nx_http_server_stop(NX_HTTP_SERVER *http_server_ptr);
579 UINT        _nx_http_server_content_get_extended(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr, ULONG byte_offset, CHAR *destination_ptr, UINT destination_size, UINT *actual_size);
580 UINT        _nx_http_server_content_length_get_extended(NX_PACKET *packet_ptr, ULONG *length);
581 UINT        _nx_http_server_get_entity_header(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr, UCHAR *entity_header_buffer, ULONG buffer_size);
582 UINT        _nx_http_server_get_entity_content(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr, ULONG *available_offset, ULONG *available_length);
583 UINT        _nx_http_server_callback_generate_response_header(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr,
584                                                               CHAR *status_code, UINT content_length, CHAR *content_type,
585                                                               CHAR* additional_header);
586 UINT        _nx_http_server_callback_generate_response_header_extended(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr, CHAR *status_code,
587                                                                        UINT status_code_length, UINT content_length, CHAR *content_type,
588                                                                        UINT content_type_length, CHAR* additional_header, UINT additional_header_length);
589 UINT        _nx_http_server_callback_packet_send(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr);
590 UINT        _nx_http_server_gmt_callback_set(NX_HTTP_SERVER *server_ptr, VOID (*gmt_callback)(NX_HTTP_SERVER_DATE *));
591 UINT        _nx_http_server_cache_info_callback_set(NX_HTTP_SERVER *server_ptr, UINT (*cache_info_get)(CHAR *, UINT *, NX_HTTP_SERVER_DATE *));
592 UINT        _nx_http_server_mime_maps_additional_set(NX_HTTP_SERVER *server_ptr, NX_HTTP_SERVER_MIME_MAP *mime_maps, UINT mime_maps_num);
593 UINT        _nx_http_server_packet_content_find(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_ptr, ULONG *content_length);
594 UINT        _nx_http_server_packet_get(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_ptr);
595 UINT        _nx_http_server_invalid_userpassword_notify_set(NX_HTTP_SERVER *http_server_ptr, UINT (*invalid_username_password_callback)(CHAR *resource, NXD_ADDRESS *client_nxd_address, UINT request_type ));
596 UINT        _nx_http_server_digest_authenticate_notify_set(NX_HTTP_SERVER *http_server_ptr,
597                                                            UINT (*digest_authenticate_callback)(NX_HTTP_SERVER *server_ptr, CHAR *name_ptr,
598                                                            CHAR *realm_ptr, CHAR *password_ptr, CHAR *method,
599                                                            CHAR *authorization_uri, CHAR *authorization_nc,
600                                                            CHAR *authorization_cnonce));
601 UINT        _nx_http_server_authentication_check_set(NX_HTTP_SERVER *http_server_ptr,
602                                                      UINT (*authentication_check_extended)(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, UINT *name_length, CHAR **password, UINT *password_length, CHAR **realm, UINT *realm_length));
603 
604 
605 
606 /* Define internal HTTP Server functions.  */
607 
608 VOID        _nx_http_server_connection_present(NX_TCP_SOCKET *socket_ptr, UINT port);
609 VOID        _nx_http_server_thread_entry(ULONG http_server_address);
610 UINT        _nx_http_server_get_client_request(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_ptr);
611 VOID        _nx_http_server_get_process(NX_HTTP_SERVER *server_ptr, UINT request_type, NX_PACKET *packet_ptr);
612 VOID        _nx_http_server_put_process(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr);
613 VOID        _nx_http_server_delete_process(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr);
614 UINT        _nx_http_server_response_send(NX_HTTP_SERVER *server_ptr, CHAR *status_code, UINT status_code_length, CHAR *information, UINT information_length, CHAR *additional_info, UINT additional_info_length);
615 UINT        _nx_http_server_basic_authenticate(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr, CHAR *name_ptr, CHAR *password_ptr, CHAR *realm_ptr, UINT realm_length, UINT *auth_request_present);
616 UINT        _nx_http_server_retrieve_basic_authorization(NX_PACKET *packet_ptr, CHAR *authorization_request_ptr);
617 UINT        _nx_http_server_retrieve_resource(NX_PACKET *packet_ptr, CHAR *destination, UINT max_size);
618 UINT        _nx_http_server_calculate_content_offset(NX_PACKET *packet_ptr);
619 UINT        _nx_http_server_type_get(NX_HTTP_SERVER *server_ptr, CHAR *name, CHAR *http_type_string);
620 UINT        _nx_http_server_type_get_extended(NX_HTTP_SERVER *server_ptr, CHAR *name, UINT name_length, CHAR *http_type_string, UINT http_type_string_max_size);
621 UINT        _nx_http_server_disconnect(NX_HTTP_SERVER *http_server_ptr, UINT wait_option);
622 
623 #ifdef  NX_HTTP_DIGEST_ENABLE
624 UINT        _nx_http_server_digest_authenticate(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr, CHAR *name_ptr, UINT name_length, CHAR *password_ptr, UINT password_length, CHAR *realm_ptr, UINT realm_length, UINT *auth_request_present);
625 VOID        _nx_http_server_digest_response_calculate(NX_HTTP_SERVER *server_ptr, CHAR *username, UINT username_length, CHAR *realm, UINT realm_length, CHAR *password, UINT password_length, CHAR *nonce, CHAR *method, CHAR *uri, CHAR *nc, CHAR *cnonce, CHAR *result);
626 UINT        _nx_http_server_retrieve_digest_authorization(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr, CHAR *response, CHAR *uri, CHAR *nc, CHAR *cnonce, NX_HTTP_SERVER_NONCE **nonce_ptr);
627 VOID        _nx_http_server_hex_ascii_convert(CHAR *source, UINT source_length, CHAR *destination);
628 UINT        _nx_http_server_nonce_allocate(NX_HTTP_SERVER *server_ptr, NX_HTTP_SERVER_NONCE **nonce_ptr);
629 #endif
630 
631 #ifdef  NX_HTTP_MULTIPART_ENABLE
632 UINT        _nx_http_server_boundary_find(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr);
633 #endif /* NX_HTTP_MULTIPART_ENABLE */
634 
635 UINT        _nx_http_server_match_string(UCHAR *src_start, UCHAR *src_end, UCHAR *target, ULONG target_length, ULONG *match_count, UCHAR **match_end_ptr);
636 UINT        _nx_http_server_field_value_get(NX_PACKET *packet_ptr, UCHAR *field_name, ULONG name_length, UCHAR *field_value, ULONG field_value_size);
637 UINT        _nx_http_server_memicmp(UCHAR *src, ULONG src_length, UCHAR *dest, ULONG dest_length);
638 
639 UINT        _nx_http_server_generate_response_header(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr, CHAR *status_code,
640                                                      UINT status_code_length, UINT content_length, CHAR *content_type,
641                                                      UINT content_type_length, CHAR* additional_header, UINT additional_header_length);
642 UINT        _nx_http_server_date_to_string(NX_HTTP_SERVER_DATE *date, CHAR *string);
643 VOID        _nx_http_server_date_convert(UINT date, UINT count, CHAR *string);
644 
645 UINT        _nxe_http_server_callback_data_send(NX_HTTP_SERVER *server_ptr, VOID *data_ptr, ULONG data_length);
646 UINT        _nxe_http_server_callback_response_send(NX_HTTP_SERVER *server_ptr, CHAR *status_code, CHAR *information, CHAR *additional_info);
647 UINT        _nxe_http_server_callback_response_send_extended(NX_HTTP_SERVER *server_ptr, CHAR *status_code, UINT status_code_length, CHAR *information, UINT infomation_length, CHAR *additional_info, UINT additional_info_length);
648 UINT        _nxe_http_server_content_get(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr, ULONG byte_offset, CHAR *destination_ptr, UINT destination_size, UINT *actual_size);
649 UINT        _nxe_http_server_packet_content_find(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_ptr, ULONG *content_length);
650 UINT        _nxe_http_server_packet_get(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_ptr);
651 UINT        _nxe_http_server_content_length_get(NX_PACKET *packet_ptr);
652 UINT        _nxe_http_server_content_get_extended(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr, ULONG byte_offset,
653                                                   CHAR *destination_ptr, UINT destination_size, UINT *actual_size);
654 UINT        _nxe_http_server_content_length_get_extended(NX_PACKET *packet_ptr, ULONG *content_length);
655 UINT        _nxe_http_server_create(NX_HTTP_SERVER *http_server_ptr, CHAR *http_server_name, NX_IP *ip_ptr, FX_MEDIA *media_ptr, VOID *stack_ptr, ULONG stack_size, NX_PACKET_POOL *pool_ptr,
656                                     UINT (*authentication_check)(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, CHAR **password, CHAR **realm),
657                                     UINT (*request_notify)(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr),
658                                     UINT http_server_size);
659 UINT        _nxe_http_server_delete(NX_HTTP_SERVER *http_server_ptr);
660 UINT        _nxe_http_server_param_get(NX_PACKET *packet_ptr, UINT param_number, CHAR *param_ptr, UINT max_param_size);
661 UINT        _nxe_http_server_query_get(NX_PACKET *packet_ptr, UINT query_number, CHAR *query_ptr, UINT max_query_size);
662 UINT        _nxe_http_server_start(NX_HTTP_SERVER *http_server_ptr);
663 UINT        _nxe_http_server_stop(NX_HTTP_SERVER *http_server_ptr);
664 UINT        _nxe_http_server_invalid_userpassword_notify_set(NX_HTTP_SERVER *http_server_ptr,
665                                                              UINT (*invalid_username_password_callback)(CHAR *resource, NXD_ADDRESS *client_nxd_address, UINT request_type));
666 UINT        _nxe_http_server_type_get(NX_HTTP_SERVER *server_ptr, CHAR *name, CHAR *http_type_string);
667 UINT        _nxe_http_server_type_get_extended(NX_HTTP_SERVER *server_ptr, CHAR *name, UINT name_length, CHAR *http_type_string, UINT http_type_string_max_size);
668 UINT        _nxe_http_server_get_entity_header(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr, UCHAR *entity_header_buffer, ULONG buffer_size);
669 UINT        _nxe_http_server_get_entity_content(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr, ULONG *available_offset, ULONG *available_length);
670 UINT        _nxe_http_server_callback_generate_response_header(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr,
671                                                                CHAR *status_code, UINT content_length, CHAR *content_type,
672                                                                CHAR* additional_header);
673 UINT        _nxe_http_server_callback_generate_response_header_extended(NX_HTTP_SERVER *server_ptr, NX_PACKET **packet_pptr, CHAR *status_code,
674                                                                         UINT status_code_length, UINT content_length, CHAR *content_type,
675                                                                         UINT content_type_length, CHAR* additional_header, UINT additional_header_length);
676 UINT        _nxe_http_server_callback_packet_send(NX_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr);
677 UINT        _nxe_http_server_gmt_callback_set(NX_HTTP_SERVER *server_ptr, VOID (*gmt_get)(NX_HTTP_SERVER_DATE *));
678 UINT        _nxe_http_server_cache_info_callback_set(NX_HTTP_SERVER *server_ptr, UINT (*cache_info_get)(CHAR *, UINT *, NX_HTTP_SERVER_DATE *));
679 UINT        _nxe_http_server_mime_maps_additional_set(NX_HTTP_SERVER *server_ptr, NX_HTTP_SERVER_MIME_MAP *mime_maps, UINT mime_maps_num);
680 UINT        _nxe_http_server_digest_authenticate_notify_set(NX_HTTP_SERVER *http_server_ptr,
681                                                             UINT (*digest_authenticate_callback)(NX_HTTP_SERVER *server_ptr, CHAR *name_ptr,
682                                                             CHAR *realm_ptr, CHAR *password_ptr, CHAR *method,
683                                                             CHAR *authorization_uri, CHAR *authorization_nc,
684                                                             CHAR *authorization_cnonce));
685 UINT        _nxe_http_server_authentication_check_set(NX_HTTP_SERVER *http_server_ptr,
686                                                       UINT (*authentication_check_extended)(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, UINT *name_length, CHAR **password, UINT *password_length, CHAR **realm, UINT *realm_length));
687 
688 #endif /* NX_HTTP_SOURCE_CODE */
689 
690 /* Determine if a C++ compiler is being used.  If so, complete the standard
691    C conditional started above.  */
692 #ifdef   __cplusplus
693         }
694 #endif
695 
696 #endif  /* NXD_HTTP_SERVER_H */
697