HTTP Client Library: D:/CC3xxx/CC3100/CC3100 SDK/CC3100 1.1.0/sdk/netapps/http/client/httpstd.h Source File

TI HTTP Client Library

httpstd.h
1 /*
2  * Copyright (c) 2014, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 #ifndef _HTTPSTD_H_
33 #define _HTTPSTD_H_
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
38 
39 /* HTTP Status Codes */
40 #define HTTP_CONTINUE 100
41 #define HTTP_SWITCHING_PROTOCOLS 101
42 #define HTTP_OK 200
43 #define HTTP_CREATED 201
44 #define HTTP_ACCEPTED 202
45 #define HTTP_NON_AUTHORITATIVE_INFORMATION 203
46 #define HTTP_NO_CONTENT 204
47 #define HTTP_RESET_CONTENT 205
48 #define HTTP_PARTIAL_CONTENT 206
49 #define HTTP_MULTIPLE_CHOICES 300
50 #define HTTP_MOVED_PERMANENTLY 301
51 #define HTTP_FOUND 302
52 #define HTTP_SEE_OTHER 303
53 #define HTTP_NOT_MODIFIED 304
54 #define HTTP_USE_PROXY 305
55 #define HTTP_TEMPORARY_REDIRECT 307
56 #define HTTP_BAD_REQUEST 400
57 #define HTTP_UNAUTHORIZED 401
58 #define HTTP_PAYMENT_REQUIRED 402
59 #define HTTP_FORBIDDEN 403
60 #define HTTP_NOT_FOUND 404
61 #define HTTP_METHOD_NOT_ALLOWED 405
62 #define HTTP_NOT_ACCEPTABLE 406
63 #define HTTP_PROXY_AUTHENTICATION_REQUIRED 407
64 #define HTTP_REQUEST_TIMEOUT 408
65 #define HTTP_CONFLICT 409
66 #define HTTP_GONE 410
67 #define HTTP_LENGTH_REQUIRED 411
68 #define HTTP_PRECONDITION_FAILED 412
69 #define HTTP_REQUEST_ENTITY_TOO_LARGE 413
70 #define HTTP_REQUEST_URI_TOO_LONG 414
71 #define HTTP_UNSUPPORTED_MEDIA_TYPE 415
72 #define HTTP_REQUESTED_RANGE_NOT_SATISFAIABLE 416
73 #define HTTP_EXPECTATION_FAILED 417
74 #define HTTP_INTERNAL_SERVER_ERROR 500
75 #define HTTP_NOT_IMPLEMENTED 501
76 #define HTTP_BAD_GATEWAY 502
77 #define HTTP_SERVICE_UNAVAILABLE 503
78 #define HTTP_GATEWAY_TIMEOUT 504
79 #define HTTP_HTTP_VERSION_NOT_SUPPORTED 505
80 
81 /* Standard ports */
82 #define HTTP_PORT 80
83 #define HTTPS_PORT 443
84 
85 static inline int is1xx(int status)
86 {
87  return ((status >= 100) && (status < 200));
88 }
89 
90 static inline int is2xx(int status)
91 {
92  return ((status >= 200) && (status < 300));
93 }
94 
95 static inline int is3xx(int status)
96 {
97  return ((status >= 300) && (status < 400));
98 }
99 
100 static inline int is4xx(int status)
101 {
102  return ((status >= 400) && (status < 500));
103 }
104 
105 static inline int is5xx(int status)
106 {
107  return ((status >= 500) && (status < 600));
108 }
109 
110 #ifdef __cplusplus
111 }
112 #endif /* __cplusplus */
113 #endif /* _HTTPSTD_H_ */
114 
Generated on Tue Jan 13 2015 14:42:03 for HTTP Client Library by   doxygen 1.8.9.1