Content-Types and Other WSP stuffs. The 1 byte Content-Type codes have typically bit 8 set. '*/*' => 0x00, 'text/*' => 0x01, 'text/html' => 0x02, 'text/plain' => 0x03, 'text/x-hdml' => 0x04, 'text/x-ttml' => 0x05, 'text/x-vCalendar' => 0x06, 'text/x-vCard' => 0x07, 'text/vnd.wap.wml' => 0x08, 'text/vnd.wap.wmlscript' => 0x09, 'text/vnd.wap.wta-event' => 0x0A, 'multipart/*' => 0x0B, 'multipart/mixed' => 0x0C, 'multipart/form-data' => 0x0D, 'multipart/byterantes' => 0x0E, 'multipart/alternative' => 0x0F, 'application/*' => 0x10, 'application/java-vm' => 0x11, 'application/x-www-form-urlencoded' => 0x12, 'application/x-hdmlc' => 0x13, 'application/vnd.wap.wmlc' => 0x14, 'application/vnd.wap.wmlscriptc' => 0x15, 'application/vnd.wap.wta-eventc' => 0x16, 'application/vnd.wap.uaprof' => 0x17, 'application/vnd.wap.wtls-ca-certificate' => 0x18, 'application/vnd.wap.wtls-user-certificate' => 0x19, 'application/x-x509-ca-cert' => 0x1A, 'application/x-x509-user-cert' => 0x1B, 'image/*' => 0x1C, 'image/gif' => 0x1D, 'image/jpeg' => 0x1E, 'image/tiff' => 0x1F, 'image/png' => 0x20, 'image/vnd.wap.wbmp' => 0x21, 'application/vnd.wap.multipart.*' => 0x22, 'application/vnd.wap.multipart.mixed' => 0x23, 'application/vnd.wap.multipart.form-data' => 0x24, 'application/vnd.wap.multipart.byteranges' => 0x25, 'application/vnd.wap.multipart.alternative' => 0x26, 'application/xml' => 0x27, 'text/xml' => 0x28, 'application/vnd.wap.wbxml' => 0x29, 'application/x-x968-cross-cert' => 0x2A, 'application/x-x968-ca-cert' => 0x2B, 'application/x-x968-user-cert' => 0x2C, 'text/vnd.wap.si' => 0x2D, 'application/vnd.wap.sic' => 0x2E, 'text/vnd.wap.sl' => 0x2F, 'application/vnd.wap.slc' => 0x30, 'text/vnd.wap.co' => 0x31, 'application/vnd.wap.coc' => 0x32, 'application/vnd.wap.multipart.related' => 0x33, 'application/vnd.wap.sia' => 0x34, 'text/vnd.wap.connectivity-xml' => 0x35, 'application/vnd.wap.connectivity-wbxml' => 0x36, 'application/pkcs7-mime' => 0x37, 'application/vnd.wap.hashed-certificate' => 0x38, 'application/vnd.wap.signed-certificate' => 0x39, 'application/vnd.wap.cert-response' => 0x3A, 'application/xhtml+xml' => 0x3B, 'application/wml+xml' => 0x3C, 'text/css' => 0x3D, 'application/vnd.wap.mms-message' => 0x3E, 'application/vnd.wap.rollover-certificate' => 0x3F, 'application/vnd.wap.locc+wbxml' => 0x40, 'application/vnd.wap.loc+xml' => 0x41, 'application/vnd.syncml.dm+wbxml' => 0x42, 'application/vnd.syncml.dm+xml' => 0x43, 'application/vnd.syncml.notification' => 0x44, 'application/vnd.wap.xhtml+xml' => 0x45, 'application/vnd.wv.csp.cir' => 0x46, 'application/vnd.oma.dd+xml' => 0x47, 'application/vnd.oma.drm.message' => 0x48, 'application/vnd.oma.drm.content' => 0x49, 'application/vnd.oma.drm.rights+xml' => 0x4A, 'application/vnd.oma.drm.rights+wbxml' => 0x4B, # extended values 'application/vnd.uplanet.cacheop-wbxml' => 0x0201, 'application/vnd.uplanet.signal' => 0x0202, 'application/vnd.uplanet.alert-wbxml' => 0x0203, 'application/vnd.uplanet.list-wbxml' => 0x0204, 'application/vnd.uplanet.listcmd-wbxml' => 0x0205, 'application/vnd.uplanet.channel-wbxml' => 0x0206, 'application/vnd.uplanet.provisioning-status-uri' => 0x0207, 'x-wap.multipart/vnd.uplanet.header-set' => 0x0208, 'application/vnd.uplanet.bearer-choice-wbxml' => 0x0209, 'application/vnd.phonecom.mmc-wbxml' => 0x020A, 'application/vnd.nokia.syncset+wbxml' => 0x020B, 'image/x-up-wpng' => 0x020C, 'application/iota.mmc-wbxml' => 0x0300, 'application/iota.mmc-xml' => 0x0301, 'application/vnd.syncml+xml' => 0x0302, 'application/vnd.syncml+wbxml' => 0x0303, 'text/vnd.wap.emn+xml' => 0x0304, 'text/calendar' => 0x0305, 'application/vnd.omads-email+xml' => 0x0306, 'application/vnd.omads-file+xml' => 0x0307, 'application/vnd.omads-folder+xml' => 0x0308, 'text/directory;profile=vCard' => 0x0309, 'application/vnd.wap.emn+wbxml' => 0x030A, 'application/vnd.nokia.ipdc-purchase-response' => 0x030B, 'application/vnd.motorola.screen3+xml' => 0x030C, 'application/vnd.motorola.screen3+gzip' => 0x030D, 'application/vnd.cmcc.setting+wbxml' => 0x030E, 'application/vnd.cmcc.bombing+wbxml' => 0x030F, }; our $WSP_CONTENT_DISPOSITIONS = { 'Form-data' => 0x00, 'Attachment' => 0x01, 'Inline' => 0x02, }; our $WSP_CONTENT_ENCODINGS = { 'Gzip' => 0x00, 'Compress' => 0x01, 'Deflate' => 0x02, }; our $WSP_CONNECTIONS = { 'Close' => 0x00, }; # Well-known character sets # see OMA-WAP-TS-WSP Appendix A our $WSP_CHARSETS = { '*' => 0x00, 'big5' => 0x07EA, 'iso-10646-ucs-2' => 0x03E8, 'iso-8859-1' => 0x04, 'iso-8859-2' => 0x05, 'iso-8859-3' => 0x06, 'iso-8859-4' => 0x07, 'iso-8859-5' => 0x08, 'iso-8859-6' => 0x09, 'iso-8859-7' => 0x0A, 'iso-8859-8' => 0x0B, 'iso-8859-9' => 0x0C, 'shift_JIS' => 0x11, 'us-ascii' => 0x03, 'utf-8' => 0x6A, }; # Well-known languages # see OMA-WAP-TS-WSP Appendix A our $WSP_LANGUAGES = { "*" => 0, "aa" => 0x01, "ab" => 0x02, "af" => 0x03, "am" => 0x04, "ar" => 0x05, "as" => 0x06, "ay" => 0x07, "az" => 0x08, "ba" => 0x09, "be" => 0x0a, "bg" => 0x0b, "bh" => 0x0c, "bi" => 0x0d, "bn" => 0x0e, "bo" => 0x0f, "br" => 0x10, "ca" => 0x11, "co" => 0x12, "cs" => 0x13, "cy" => 0x14, "da" => 0x15, "de" => 0x16, "dz" => 0x17, "el" => 0x18, "en" => 0x19, "eo" => 0x1a, "es" => 0x1b, "et" => 0x1c, "eu" => 0x1d, "fa" => 0x1e, "fi" => 0x1f, "fj" => 0x20, "fo" => 0x82, "fr" => 0x22, "fy" => 0x83, "ga" => 0x24, "gd" => 0x25, "gl" => 0x26, "gn" => 0x27, "gu" => 0x28, "ha" => 0x29, "he" => 0x2a, "hi" => 0x2b, "hr" => 0x2c, "hu" => 0x2d, "hy" => 0x2e, "ia" => 0x84, "id" => 0x30, "ie" => 0x86, "ik" => 0x87, "is" => 0x33, "it" => 0x34, "iu" => 0x89, "ja" => 0x36, "jw" => 0x37, "ka" => 0x38, "kk" => 0x39, "kl" => 0x8a, "km" => 0x3b, "kn" => 0x3c, "ko" => 0x3d, "ks" => 0x3e, "ku" => 0x3f, "ky" => 0x40, "la" => 0x8b, "ln" => 0x42, "lo" => 0x43, "lt" => 0x44, "lv" => 0x45, "mg" => 0x46, "mi" => 0x47, "mk" => 0x48, "ml" => 0x49, "mn" => 0x4a, "mo" => 0x4b, "mr" => 0x4c, "ms" => 0x4d, "mt" => 0x4e, "my" => 0x4f, "na" => 0x81, "ne" => 0x51, "nl" => 0x52, "no" => 0x53, "oc" => 0x54, "om" => 0x55, "or" => 0x56, "pa" => 0x57, "pl" => 0x58, "ps" => 0x59, "pt" => 0x5a, "qu" => 0x5b, "rm" => 0x8c, "rn" => 0x5d, "ro" => 0x5e, "ru" => 0x5f, "rw" => 0x60, "sa" => 0x61, "sd" => 0x62, "sg" => 0x63, "sh" => 0x64, "si" => 0x65, "sk" => 0x66, "sl" => 0x67, "sm" => 0x68, "sn" => 0x69, "so" => 0x6a, "sq" => 0x6b, "sr" => 0x6c, "ss" => 0x6d, "st" => 0x6e, "su" => 0x6f, "sv" => 0x70, "sw" => 0x71, "ta" => 0x72, "te" => 0x73, "tg" => 0x74, "th" => 0x75, "ti" => 0x76, "tk" => 0x77, "tl" => 0x78, "tn" => 0x79, "to" => 0x7a, "tr" => 0x7b, "ts" => 0x7c, "tt" => 0x7d, "tw" => 0x7e, "ug" => 0x7f, "uk" => 0x50, "ur" => 0x21, "uz" => 0x23, "vi" => 0x2f, "vo" => 0x85, "wo" => 0x31, "xh" => 0x32, "yi" => 0x88, "yo" => 0x35, "za" => 0x3a, "zh" => 0x41, "zu" => 0x5c, "zu" => 0x5c, }; our $WSP_METHODS = { "GET" => 0x40, "OPTIONS" => 0x41, "HEAD" => 0x42, "DELETE" => 0x43, "TRACE" => 0x44, "POST" => 0x60, "PUT" => 0x61, }; our $WSP_ACCEPT_RANGES = { 'None' => 0x00, 'Bytes', => 0x01, }; our $WSP_SEC_PINS = { NETWPIN => 0x00, USERPIN => 0x01, USERNETWPIN => 0x02, USERPINMAC => 0x03, }; our $WSP_HEADERS = [ [ 'Accept', 0x00, 'accept_value', LIST ], [ 'Accept-Language', 0x03, 'accept_language_value',LIST ], [ 'Accept-Ranges', 0x04, 'accept_ranges_value', LIST ], [ 'Age', 0x05, 'integer_value', NOLIST ], [ 'Allow', 0x06, 'allow_value', LIST ], # TODO [ 'Authorization', 0x07, 'credentials', BRKLIST ], [ 'Connection', 0x09, 'connection_value', LIST ], [ 'Content-Base', 0x0A, 'text_string', NOLIST ], [ 'Content-Encoding', 0x0B, 'content_encoding_value', LIST ], [ 'Content-Language', 0x0C, 'content_language_value', LIST ], [ 'Content-Length', 0x0D, 'integer_value', NOLIST ], [ 'Content-Location', 0x0E, 'text_string', NOLIST ], [ 'Content-MD5', 0x0F, 'content_md5_value', NOLIST ], [ 'Content-Type', 0x11, 'accept_value', NOLIST ], [ 'Date', 0x12, 'date_value', NOLIST ], [ 'Etag', 0x13, 'text_string', NOLIST ], [ 'Expires', 0x14, 'date_value', NOLIST ], [ 'From', 0x15, 'text_string', NOLIST ], [ 'Host', 0x16, 'text_string', NOLIST ], [ 'If-Modified-Since', 0x17, 'date_value', NOLIST ], [ 'If-Match', 0x18, 'text_string', NOLIST ], [ 'If-None-Match', 0x19, 'text_string', NOLIST ], # TODO [ 'If-Range', 0x1A, 'if_range', NOLIST ], [ 'If-Unmodified-Since', 0x1B, 'date_value', NOLIST ], [ 'Location', 0x1C, 'text_string', NOLIST ], [ 'Last-Modified', 0x1D, 'date_value', NOLIST ], [ 'Max-Forwards', 0x1E, 'integer_value', NOLIST ], # TODO [ 'Pragma', 0x1F, 'pragma_value', LIST ], # TODO [ 'Proxy-Authenticate', 0x20, 'challenge', BRKLIST ], # TODO [ 'Proxy-Authorization', 0x21, 'credentials', BRKLIST ], [ 'Public', 0x22, 'public_value', LIST ], [ 'Range', 0x23, 'range', NOLIST ], [ 'Referer', 0x24, 'text_string', NOLIST ], [ 'Retry-After', 0x25, 'retry_after_value', NOLIST ], [ 'Server', 0x26, 'text_string', NOLIST ], [ 'Transfer-Encoding', 0x27, 'transfer_encoding_value', LIST ], [ 'Upgrade', 0x28, 'text_string', NOLIST ], [ 'User-Agent', 0x29, 'text_string', NOLIST ], [ 'Vary', 0x2A, 'field_name', LIST ], [ 'Via', 0x2B, 'text_string', LIST ], # TODO [ 'Warning', 0x2C, 'warning', LIST ], # TODO [ 'WWW-Authenticate', 0x2D, 'challenge', BRKLIST ], [ 'X-Wap-Application-Id', 0x2F, 'integer_value', NOLIST ], [ 'X-Wap-Content-URI', 0x30, 'text_string', NOLIST ], [ 'X-Wap-Initiator-URI', 0x31, 'text_string', NOLIST ], # TODO [ 'Accept-Application', 0x32, ], [ 'Bearer-Indication', 0x33, 'integer_value', NOLIST ], [ 'Push-Flag', 0x34, 'short_integer', NOLIST ], [ 'Profile', 0x35, 'text_string', NOLIST ], # TODO [ 'Profile-Diff', 0x36, ], # TODO [ 'TE', 0x39, ], # TODO [ 'Trailer', 0x3A, ], [ 'Accept-Charset', 0x3B, 'accept_charset_value', LIST ], [ 'Accept-Encoding', 0x3C, 'accept_encoding_value',LIST ], # TODO [ 'Content-Range', 0x3E, 'content_range', LIST ], # TODO [ 'X-Wap-Tod', 0x3F, ], [ 'Content-ID', 0x40, 'quoted_string', NOLIST ], [ 'Set-Cookie', 0x41, 'text_string', LIST ], [ 'Cookie', 0x42, 'text_string', LIST ], # TODO [ 'Encoding-Version', 0x43, 'encoding_version_value', NOLIST], # TODO [ 'Profile-Warning', 0x44, ], [ 'Content-Disposition', 0x45, 'content_disposition_value', NOLIST ], # TODO [ 'X-WAP-Security', 0x46, ], # TODO [ 'Cache-Control', 0x47, 'cache_control', LIST ], # TODO [ 'Expect', 0x48, ], # TODO [ 'X-Wap-Loc-Invocation', 0x49, ], # TODO [ 'X-Wap-Loc-Delivery', 0x4A, ], ]; our $WSP_PARAMETERS = [ [ 'Q', 0x00, 'q_value' ], [ 'Charset', 0x01, 'well_known_charset' ], [ 'Level', 0x02, 'version_value' ], [ 'Type', 0x03, 'integer_value' ], [ 'Name', 0x05, 'text_string' ], [ 'Filename', 0x06, 'text_string' ], # TODO [ 'Differences', 0x07, 'field_name' ], [ 'Padding', 0x08, 'short_integer' ], # TODO [ 'Type', 0x09, 'constrained_encoding' ] [ 'Start', 0x0A, 'text_string' ], [ 'Start-info', 0x0B, 'text_string' ], [ 'Comment', 0x0C, 'text_string' ], [ 'Domain', 0x0D, 'text_string' ], [ 'Max-Age', 0x0E, 'integer_value' ], [ 'Path', 0x0F, 'text_string' ], [ 'Secure', 0x10, 'no_value' ], [ 'SEC', 0x11, 'sec_value' ], [ 'MAC', 0x12, 'text_string' ], [ 'Creation-date', 0x13, 'date_value' ], [ 'Modification-date', 0x14, 'date_value' ], [ 'Read-date', 0x15, 'date_value' ], [ 'Size', 0x16, 'integer_value' ], [ 'Name', 0x17, 'text_value' ], [ 'Filename', 0x18, 'text_value' ], [ 'Start', 0x19, 'text_value' ], [ 'Start-info', 0x1A, 'text_value' ], [ 'Comment', 0x1B, 'text_value' ], [ 'Domain', 0x1C, 'text_value' ], [ 'Path', 0x1D, 'text_value' ], ];