include/alp/http_const.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright (c) 1999-2008 ACCESS CO., LTD. All rights reserved.
00003  * Copyright (c) 2006 PalmSource, Inc (an ACCESS company). All rights reserved.
00004  *********************************************************************************/
00012 #ifndef _HTTP_CONST_H_
00013 #define _HTTP_CONST_H_
00014 
00028 #define HTTP_FALSE 0 
00029 #define HTTP_TRUE (!HTTP_FALSE)
00030 
00032 enum _AlpHttpVersion {
00033     httpVersion_0_9 = 0, 
00034     httpVersion_1_0,     
00035     httpVersion_1_1,     
00036     httpVersionVersions
00037 };
00038 typedef enum _AlpHttpVersion AlpHttpVersionEnum;
00039 
00041 enum _AlpHttpMethod {
00042     httpMethodGET = 1,          
00043     httpMethodPOST = 3,         
00044     httpMethodMethods
00045 };
00046 typedef enum _AlpHttpMethod AlpHttpMethodEnum;
00047 
00048 
00050 enum _AlpHttpScheme {
00051     httpSchemeHTTP = 0,
00052     httpSchemeHTTPS,
00053     httpSchemeSchemes
00054 };
00055 typedef enum _AlpHttpScheme AlpHttpSchemeEnum;
00056 
00058 enum _AlpHttpCookie {
00059     httpCookieNotifyBeforeSet = 0,      
00060     httpCookieAlwaysSet,                
00061     httpCookieNeverSet                  
00062 };
00063 typedef enum _AlpHttpCookie AlpHttpCookieEnum;
00064 
00066 enum {
00067     httpDNSModeIPV4Only = 0     
00068 };
00069 
00070 /* IP address type */
00071 #define httpIPAddrTypeV4  4
00072 
00073 /* string encoding in post */
00074 #define httpPostURLENCODED              0x00000001
00075 #define httpPostPLAINTEXT               0x00000002
00076 #define httpPostMULTIPART               0x00000004
00077 
00078 #define httpStreamRead          0x00000001
00079 #define httpStreamWrite         0x00000002
00080 #define httpStreamReadWrite     (httpStreamRead|httpStreamWrite)
00081 
00082 #define httpStreamTextCRLF                              "\015\012"
00083 #define httpStreamTextCRLFCRLF                  "\015\012\015\012"
00084 #define httpStreamTextCRCR                              "\015\015"
00085 #define httpStreamTextLFLF                              "\012\012"
00086 
00088 
00089 enum _AlpHttpAuthType {
00090     httpAuthTypeNone = -1,      
00091     httpAuthTypeBasic = 0,      
00092     httpAuthTypeDigest,         
00093     httpAuthTypeTypes
00094 };
00095 typedef enum _AlpHttpAuthType AlpHttpAuthTypeEnum;
00096 
00098 
00099 enum _AlpHttpAuthTarget {
00100     httpAuthTargetPage = 0,     
00101     httpAuthTargetProxy,        
00102     httpAuthTargetTargets
00103 };
00104 typedef enum _AlpHttpAuthTarget AlpHttpAuthTargetEnum;
00105 
00106 
00108 
00115 enum _AlpHttpStatusCode {
00116     httpStatusCodeContinue                              = 100,
00117     httpStatusCodeSwitchingProtocols                    = 101,
00118     httpStatusCodeOK                                    = 200,
00119     httpStatusCodeCreated                               = 201,
00120     httpStatusCodeAccepted                              = 202,
00121     httpStatusCodeNonAuthoritativeInformation           = 203,
00122     httpStatusCodeNoContent                             = 204,
00123     httpStatusCodeResetContent                          = 205,
00124     httpStatusCodePartialContent                        = 206,
00125     httpStatusCodeMultipleChoices                       = 300,
00126     httpStatusCodeMovedPermanently                      = 301,
00127     httpStatusCodeFound                                 = 302,
00128     httpStatusCodeSeeOther                              = 303,
00129     httpStatusCodeNotModified                           = 304,
00130     httpStatusCodeUseProxy                              = 305,
00131     httpStatusCodeTemporaryRedirect                     = 307,
00132     httpStatusCodeBadRequest                            = 400,
00133     httpStatusCodeUnauthorized                          = 401,
00134     httpStatusCodePaymentRequired                       = 402,
00135     httpStatusCodeForbidden                             = 403,
00136     httpStatusCodeNotFound                              = 404,
00137     httpStatusCodeMethodNotAllowed                      = 405,
00138     httpStatusCodeNotAcceptable                         = 406,
00139     httpStatusCodeProxyAuthenticationRequired           = 407,
00140     httpStatusCodeRequestTimeout                        = 408,
00141     httpStatusCodeConflict                              = 409,
00142     httpStatusCodeGone                                  = 410,
00143     httpStatusCodeLengthRequired                        = 411,
00144     httpStatusCodePreconditionFailed                    = 412,
00145     httpStatusCodeRequestEntityTooLarge                 = 413,
00146     httpStatusCodeRequestURITooLarge                    = 414,
00147     httpStatusCodeUnsupportedMediaType                  = 415,
00148     httpStatusCodeRequestedRangeNotSatisfiable          = 416,
00149     httpStatusCodeExpectationFailed                     = 417,
00150     httpStatusCodeInternalServerError                   = 500,
00151     httpStatusCodeNotImplemented                        = 501,
00152     httpStatusCodeBadGateway                            = 502,
00153     httpStatusCodeServiceUnavailable                    = 503,
00154     httpStatusCodeGatewayTimeout                        = 504,
00155     httpStatusCodeHTTPVersionNotSupported               = 505
00156 };
00157 typedef enum _AlpHttpStatusCode AlpHttpStatusCodeEnum;
00158 
00159 
00161 enum _AlpHttpStreamState {
00162     httpStreamStateNew = 0,
00163     httpStreamStateDormant,
00164     httpStreamStateReqCreated,
00165     httpStreamStateReqResolve,
00166     httpStreamStateReqResolving,
00167     httpStreamStateReqOpen,
00168     httpStreamStateReqConnect,
00169     httpStreamStateReqConnecting,
00170     httpStreamStateReqProxyConnect,
00171     httpStreamStateReqProxyConnecting,
00172     httpStreamStateReqSSLHandShaking,
00173     httpStreamStateReqSSLHandShaked,
00174     httpStreamStateReqSending,
00175     httpStreamStateReqSent,
00176     httpStreamStateRspHeaderWaiting,
00177     httpStreamStateRspContinue,
00178     httpStreamStateRspHeaderReceiving,
00179     httpStreamStateRspHeaderReceived,
00180     httpStreamStateRspEntityReceiving,
00181     httpStreamStateRspEntityReceived,
00182     httpStreamStateObsolete,
00183     httpStreamStateDelete,
00184     httpStreamStateStates
00185 };
00186 typedef enum _AlpHttpStreamState AlpHttpStreamStateEnum;
00187 
00189 enum _AlpHttpError {
00190 
00191         httpErrorOK                 = 0,
00192         httpErrorGeneric            = -1,
00193         httpErrorWouldBlock         = -2,
00194         httpErrorIOSleep            = -3,
00195         httpErrorNoMem              = -6,
00196         httpErrorStrPipe            = -7,
00197         httpErrorInval              = -8,
00198         httpErrorEOF                = -9,
00199         httpErrorNotSupported       = -10,
00200 
00201         httpErrorDNSInval           = -200,
00202         httpErrorDNSNoServer,
00203         httpErrorDNSTimedout,
00204         httpErrorDNSNotFound,
00205         httpErrorTCPOpen,
00206         httpErrorTCPConnect,
00207         httpErrorTCPRead,
00208         httpErrorTCPWrite,
00209         httpErrorSSLConnect,
00210         httpErrorSSLHandShake,
00211         httpErrorSSLRead,
00212         httpErrorSSLWrite,
00213         httpErrorReqTimedout,
00214         httpErrorRspTimedout,
00215         httpErrorCacheNone,
00216         httpErrorCacheExpire,
00217         httpErrorAuthUnknown,
00218         httpErrorAuthNoHeader,
00219         httpErrorAuthFormat,
00220         httpErrorAuthIgnored,
00221         httpErrorRedirectFormat,
00222         httpErrorRedirectCanceled,
00223         httpErrorRedirectIgnored,
00224         httpErrorReqHeaderSizeOver,  
00225         httpErrorReqBodySizeOver,    
00226         httpErrorRspHeaderSizeOver,
00227         httpErrorReqTooManyContinue,
00228         httpErrorTLSIntolerant
00229 };
00230 typedef enum _AlpHttpError AlpHttpErrorEnum;
00231 
00233 enum _AlpHttpHeaderID {
00234         httpHeaderIDCacheControl,       
00235         httpHeaderIDConnection,         
00236         httpHeaderIDDate,               
00237         httpHeaderIDPragma,             
00238         httpHeaderIDTrailer,            
00239         httpHeaderIDTransferEncoding,   
00240         httpHeaderIDUpgrade,            
00241         httpHeaderIDVia,                
00242         httpHeaderIDWarning,            
00243         httpHeaderIDKeepAlive,          
00244         httpHeaderIDProxyConnection,    
00245         httpHeaderIDAccept,             
00246         httpHeaderIDAcceptCharset,      
00247         httpHeaderIDAcceptEncoding,     
00248         httpHeaderIDAcceptLanguage,     
00249         httpHeaderIDAuthorization,      
00250         httpHeaderIDExpect,             
00251         httpHeaderIDFrom,               
00252         httpHeaderIDHost,               
00253         httpHeaderIDIfMatch,            
00254         httpHeaderIDIfModifiedSince,    
00255         httpHeaderIDIfNoneMatch,        
00256         httpHeaderIDIfRange,            
00257         httpHeaderIDIfUnmodifiedSince,  
00258         httpHeaderIDMaxForwards,        
00259         httpHeaderIDProxyAuthorization, 
00260         httpHeaderIDRange,              
00261         httpHeaderIDReferer,            
00262         httpHeaderIDTE,                 
00263         httpHeaderIDUserAgent,          
00264         httpHeaderIDCookie,             
00265         httpHeaderIDAcceptRanges,       
00266         httpHeaderIDAge,                
00267         httpHeaderIDETag,               
00268         httpHeaderIDLocation,           
00269         httpHeaderIDProxyAuthenticate,  
00270         httpHeaderIDRetryAfter,         
00271         httpHeaderIDServer,             
00272         httpHeaderIDVary,               
00273         httpHeaderIDWWWAuthenticate,    
00274         httpHeaderIDSetCookie,          
00275         httpHeaderIDAuthenticationInfo, 
00276         httpHeaderIDProxyAuthenticationInfo,
00277         httpHeaderIDAllow,              
00278         httpHeaderIDContentEncoding,    
00279         httpHeaderIDContentDisposition,
00280         httpHeaderIDContentLanguage,    
00281         httpHeaderIDContentLength,      
00282         httpHeaderIDContentLocation,    
00283         httpHeaderIDContentMD5,         
00284         httpHeaderIDContentRange,       
00285         httpHeaderIDContentType,        
00286         httpHeaderIDExpires,            
00287         httpHeaderIDLastModified,       
00288         httpHeaderIDRefresh,            
00289         httpHeaderIDENUMS
00290 };
00291 typedef enum _AlpHttpHeaderID AlpHttpHeaderIDEnum;
00292 
00293 /* SSL Version */
00294 #define httpSSLFlagConnV2       0x00000001      /* connect by v2 protocol */
00295 #define httpSSLFlagConnV3       0x00000002      /* connect by v3 protocol */
00296 #define httpSSLFlagConnTLS      0x00000004      /* connect by TLS(v3.1) protocol */
00297 #define httpSSLFlagConnV2V3     (httpSSLFlagConnV2 | httpSSLFlagConnV3)
00298 #define httpSSLFlagConnV2TLS    (httpSSLFlagConnV2 | httpSSLFlagConnTLS)
00299 #define httpSSLFlagConnV3TLS    (httpSSLFlagConnV3 | httpSSLFlagConnTLS)
00300 #define httpSSLFlagConnV2V3TLS  (httpSSLFlagConnV2 | httpSSLFlagConnV3 | httpSSLFlagConnTLS)
00301 
00302 
00304 enum{
00305     httpCertDNCountryName = 0,          
00306     httpCertDNStateOrProvinceName,      
00307     httpCertDNLocalityName,             
00308     httpCertDNStreetAddress,            
00309     httpCertDNOrganizationName,         
00310     httpCertDNOrganizationUnitName,     
00311     httpCertDNCommonName,               
00312     httpCertDNEmailAddress,             
00313     httpCertDNAttributs
00314 
00315 };
00316 
00317 
00319 enum {
00320     httpCertListTypeUnknown = 0,
00321     httpCertListTypeServer,
00322     httpCertListTypeClient,
00323     httpCertListTypeBrowser,
00324     httpCertListTypeTypes
00325 };
00326 
00328 enum {
00329     httpCertListEOK = 0,
00330     httpCertListEGeneric = -1,
00331     httpCertListENoMem = -2,
00332     httpCertListESame = -3,
00333     httpCertListEDecode = -4,
00334     httpCertListEFull = -5    
00335 };
00336 
00337 
00341 #endif /* _HTTP_CONST_H_ */
00342 

Generated on Wed Jul 30 07:06:39 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.