#pragma once



// libHttp = 0x80710001 - 0x80710fff
// libHttps = 0x80710a01 - 0x80710aff

// Error Codes - Http
enum
{
	CELL_HTTP_NET_ERROR_TYPE_MASK = 0xffffff00,
	CELL_HTTP_NET_ERROR_MASK = 0xff,

	// CELL_HTTP_NET_ERROR
	// CELL_HTTP_IS_NET_RESOLVER_ERROR

	CELL_HTTP_ERROR_ALREADY_INITIALIZED = 0x80710001,
	CELL_HTTP_ERROR_NOT_INITIALIZED = 0x80710002,
	CELL_HTTP_ERROR_NO_MEMORY = 0x80710003,
	CELL_HTTP_ERROR_NO_BUFFER = 0x80710004,
	CELL_HTTP_ERROR_NO_STRING = 0x80710005,
	CELL_HTTP_ERROR_INSUFFICIENT = 0x80710006,
	CELL_HTTP_ERROR_INVALID_URI = 0x80710007,
	CELL_HTTP_ERROR_INVALID_HEADER = 0x80710008,
	CELL_HTTP_ERROR_BAD_METHOD = 0x80710009,
	CELL_HTTP_ERROR_BAD_CLIENT = 0x80710010,
	CELL_HTTP_ERROR_BAD_TRANS = 0x80710011,
	CELL_HTTP_ERROR_NO_CONNECTION = 0x80710012,
	CELL_HTTP_ERROR_NO_REQUEST_SENT = 0x80710013,
	CELL_HTTP_ERROR_ALREADY_BUILT = 0x80710014,
	CELL_HTTP_ERROR_ALREADY_SENT = 0x80710015,
	CELL_HTTP_ERROR_NO_HEADER = 0x80710016,
	CELL_HTTP_ERROR_NO_CONTENT_LENGTH = 0x80710017,
	CELL_HTTP_ERROR_TOO_MANY_REDIRECTS = 0x80710018,
	CELL_HTTP_ERROR_TOO_MANY_AUTHS = 0x80710019,
	CELL_HTTP_ERROR_TRANS_NO_CONNECTION = 0x80710020,
	CELL_HTTP_ERROR_CB_FAILED = 0x80710021,
	CELL_HTTP_ERROR_NOT_PIPED = 0x80710022,
	CELL_HTTP_ERROR_OUT_OF_ORDER_PIPE = 0x80710023,
	CELL_HTTP_ERROR_TRANS_ABORTED = 0x80710024,
	CELL_HTTP_ERROR_BROKEN_PIPELINE = 0x80710025,
	CELL_HTTP_ERROR_UNAVAILABLE = 0x80710026,
	CELL_HTTP_ERROR_INVALID_VALUE = 0x80710027,
	CELL_HTTP_ERROR_CANNOT_AUTHENTICATE = 0x80710028,
	CELL_HTTP_ERROR_COOKIE_NOT_FOUND = 0x80710041,
	CELL_HTTP_ERROR_COOKIE_INVALID_DOMAIN = 0x80710042,
	CELL_HTTP_ERROR_CACHE_ALREADY_INITIALIZED = 0x80710043,
	CELL_HTTP_ERROR_CACHE_NOT_INITIALIZED = 0x80710044,
	CELL_HTTP_ERROR_LINE_EXCEEDS_MAX = 0x80710045,
	CELL_HTTP_ERROR_REQUIRES_BASIC_AUTH = 0x80710046,

	CELL_HTTP_ERROR_UNKNOWN = 0x80710051,
	CELL_HTTP_ERROR_INTERNAL = 0x80710052,
	CELL_HTTP_ERROR_NONREMOVABLE = 0x80710053,
	CELL_HTTP_ERROR_BAD_CONN = 0x80710054,
	CELL_HTTP_ERROR_BAD_MAN = 0x80710055,
	CELL_HTTP_ERROR_NO_POOL = 0x80710056,
	CELL_HTTP_ERROR_NO_REQUEST = 0x80710057,
	CELL_HTTP_ERROR_LOCK_FAILED = 0x80710058,
	CELL_HTTP_ERROR_INVALID_DATA = 0x80710059,
	CELL_HTTP_ERROR_BROKEN_CHUNK = 0x8071005a,
	CELL_HTTP_ERROR_DECODE_SETUP = 0x8071005b,
	CELL_HTTP_ERROR_DECODE_STREAM = 0x8071005c,
	CELL_HTTP_ERROR_BROKEN_DECODE_STREAM = 0x8071005d,

	CELL_HTTP_ERROR_INVALID_DCACHE_PATH = 0x80710060,
	CELL_HTTP_ERROR_DCACHE_ALREADY_INITIALIZED = 0x80710061,
	CELL_HTTP_ERROR_DCACHE_NOT_INITIALIZED = 0x80710062,
	CELL_HTTP_ERROR_TOO_MANY_DCACHE_ENTRY = 0x80710063,
	CELL_HTTP_ERROR_DUP_DCACHE_ENTRY = 0x80710064,
	CELL_HTTP_ERROR_WRITE_DCACHE = 0x80710065,
	CELL_HTTP_ERROR_READ_DCACHE = 0x80710066,
	CELL_HTTP_ERROR_CACHE_TOO_LARGE = 0x80710067,
	CELL_HTTP_ERROR_INVALID_DCACHE_VERSION = 0x80710068,
	CELL_HTTP_ERROR_DCACHE_FILE_BROKEN = 0x80710069,
	CELL_HTTP_ERROR_DCACHE_EXCEEDS_MAX = 0x8071006a,
	CELL_HTTP_ERROR_DCACHE_BUSY = 0x8071006b,
	CELL_HTTP_ERROR_DCACHE_INDEX_BROKEN = 0x8071006c,
	CELL_HTTP_ERROR_INVALID_DCACHE_INDEX_NODE = 0x8071006d,
	CELL_HTTP_ERROR_DCACHE_FILE_INCONSISTENCY = 0x8071006e,
	CELL_HTTP_ERROR_DCACHE_URI_TOO_LONG = 0x8071006f,
	CELL_HTTP_ERROR_READ_DCACHE_EOF = 0x80710070,
	CELL_HTTP_ERROR_END_OF_DCACHE_INDEX_NODE = 0x80710071,
	CELL_HTTP_ERROR_NO_CACHE_MEMORY = 0x80710072,
	CELL_HTTP_ERROR_DCACHE_BROKEN = 0x80710073,
	CELL_HTTP_ERROR_DCACHE_TOO_MANY_WRITE = 0x80710074,
	CELL_HTTP_ERROR_DCACHE_TOO_MANY_READ = 0x80710075,
	CELL_HTTP_ERROR_DCACHE_FATAL = 0x80710076,
	CELL_HTTP_ERROR_DCACHE_UNSUPPORTED_FEATURE = 0x80710077,
	CELL_HTTP_ERROR_DCACHE_INDEX_IS_ALREADY_OPEN = 0x80710078,
	CELL_HTTP_ERROR_DCACHE_INDEX_IS_OPENING = 0x80710079,
	CELL_HTTP_ERROR_DCACHE_UNKNOWN = 0x80710080,
	CELL_HTTP_ERROR_DCACHE_INDEX_IS_CLOSED = 0x80710081,
	CELL_HTTP_ERROR_DCACHE_ABORTED = 0x80710082,
	CELL_HTTP_ERROR_DCACHE_INDEX_IS_CLOSING = 0x80710083,
	CELL_HTTP_ERROR_DCACHE_UNKNOWN_INDEX_STATE = 0x80710084,

	CELL_HTTP_ERROR_NET_FIN = 0x80710091,
	CELL_HTTP_ERROR_NET_CONNECT_TIMEOUT = 0x80710092,
	CELL_HTTP_ERROR_NET_SELECT_TIMEOUT = 0x80710093,
	CELL_HTTP_ERROR_NET_SEND_TIMEOUT = 0x80710094,

	CELL_HTTP_ERROR_NET_RESOLVER = 0x80710100,
	CELL_HTTP_ERROR_NET_ABORT = 0x80710200,
	CELL_HTTP_ERROR_NET_OPTION = 0x80710300,
	CELL_HTTP_ERROR_NET_SOCKET = 0x80710400,
	CELL_HTTP_ERROR_NET_CONNECT = 0x80710500,
	CELL_HTTP_ERROR_NET_SEND = 0x80710600,
	CELL_HTTP_ERROR_NET_RECV = 0x80710700,
	CELL_HTTP_ERROR_NET_SELECT = 0x80710800,
};

// Error Codes - Https
enum
{
	CELL_HTTPS_ERROR_CERTIFICATE_LOAD = 0x80710a01,
	CELL_HTTPS_ERROR_BAD_MEMORY = 0x80710a02,
	CELL_HTTPS_ERROR_CONTEXT_CREATION = 0x80710a03,
	CELL_HTTPS_ERROR_CONNECTION_CREATION = 0x80710a04,
	CELL_HTTPS_ERROR_SOCKET_ASSOCIATION = 0x80710a05,
	CELL_HTTPS_ERROR_HANDSHAKE = 0x80710a06,
	CELL_HTTPS_ERROR_LOOKUP_CERTIFICATE = 0x80710a07,
	CELL_HTTPS_ERROR_NO_SSL = 0x80710a08,
	CELL_HTTPS_ERROR_KEY_LOAD = 0x80710a09,
	CELL_HTTPS_ERROR_CERT_KEY_MISMATCH = 0x80710a0a,
	CELL_HTTPS_ERROR_KEY_NEEDS_CERT = 0x80710a0b,
	CELL_HTTPS_ERROR_CERT_NEEDS_KEY = 0x80710a0c,
	CELL_HTTPS_ERROR_RETRY_CONNECTION = 0x80710a01d,
	CELL_HTTPS_ERROR_NET_SSL_CONNECT = 0x80710b00,
	CELL_HTTPS_ERROR_NET_SSL_SEND = 0x80710c00,
	CELL_HTTPS_ERROR_NET_SSL_RECV = 0x80710d00,
};
