| 1 | { | ||
| 2 | { | ||
| 3 | my %parameter_name_for = ( | ||
| 4 | 0x80 => 'q', | ||
| 5 | 0x81 => 'charset', | ||
| 6 | 0x82 => 'level', | ||
| 7 | 0x83 => 'type', | ||
| 8 | 0x85 => 'name', | ||
| 9 | 0x86 => 'filename', | ||
| 10 | 0x87 => 'differences', | ||
| 11 | 0x88 => 'padding', | ||
| 12 | 0x89 => 'type', | ||
| 13 | 0x8a => 'start', | ||
| 14 | 0x8b => 'start_info', | ||
| 15 | 0x8c => 'comment', | ||
| 16 | 0x8d => 'domain', | ||
| 17 | 0x8e => 'max_age', | ||
| 18 | 0x8f => 'path', | ||
| 19 | 0x90 => 'secure', | ||
| 20 | 0x91 => 'SEC', | ||
| 21 | 0x92 => 'MAC', | ||
| 22 | 0x93 => 'creation_date', | ||
| 23 | 0x94 => 'modification_date', | ||
| 24 | 0x95 => 'read_date', | ||
| 25 | 0x96 => 'size', | ||
| 26 | 0x97 => 'name', | ||
| 27 | 0x98 => 'filename', | ||
| 28 | 0x99 => 'start', | ||
| 29 | 0x9a => 'start_info', | ||
| 30 | 0x9b => 'comment', | ||
| 31 | 0x9c => 'domain', | ||
| 32 | 0x9d => 'path', | ||
| 33 | ); | ||
| 34 | |||
| 35 | sub build_parameter { | ||
| 36 | my ($rulename, $code, $value, $encoding) = @_; | ||
| 37 | return { | ||
| 38 | name => $parameter_name_for{ord $code}, | ||
| 39 | value => $value, | ||
| 40 | encoding => $encoding, | ||
| 41 | }; | ||
| 42 | } ## end sub build_parameter | ||
| 43 | } | ||
| 44 | |||
| 45 | { | ||
| 46 | my %media_type_for = ( | ||
| 47 | 0x00 => '*/*', | ||
| 48 | 0x01 => 'text/*', | ||
| 49 | 0x02 => 'text/html', | ||
| 50 | 0x03 => 'text/plain', | ||
| 51 | 0x04 => 'text/x-hdml', | ||
| 52 | 0x05 => 'text/x-ttml', | ||
| 53 | 0x06 => 'text/x-vCalendar', | ||
| 54 | 0x07 => 'text/x-vCard', | ||
| 55 | 0x08 => 'text/vnd.wap.wml', | ||
| 56 | 0x09 => 'text/vnd.wap.wmlscript', | ||
| 57 | 0x0A => 'text/vnd.wap.wta-event', | ||
| 58 | 0x0B => 'multipart/*', | ||
| 59 | 0x0C => 'multipart/mixed', | ||
| 60 | 0x0D => 'multipart/form-data', | ||
| 61 | 0x0E => 'multipart/byterantes', | ||
| 62 | 0x0F => 'multipart/alternative', | ||
| 63 | 0x10 => 'application/*', | ||
| 64 | 0x11 => 'application/java-vm', | ||
| 65 | 0x12 => 'application/x-www-form-urlencoded', | ||
| 66 | 0x13 => 'application/x-hdmlc', | ||
| 67 | 0x14 => 'application/vnd.wap.wmlc', | ||
| 68 | 0x15 => 'application/vnd.wap.wmlscriptc', | ||
| 69 | 0x16 => 'application/vnd.wap.wta-eventc', | ||
| 70 | 0x17 => 'application/vnd.wap.uaprof', | ||
| 71 | 0x18 => 'application/vnd.wap.wtls-ca-certificate', | ||
| 72 | 0x19 => 'application/vnd.wap.wtls-user-certificate', | ||
| 73 | 0x1A => 'application/x-x509-ca-cert', | ||
| 74 | 0x1B => 'application/x-x509-user-cert', | ||
| 75 | 0x1C => 'image/*', | ||
| 76 | 0x1D => 'image/gif', | ||
| 77 | 0x1E => 'image/jpeg', | ||
| 78 | 0x1F => 'image/tiff', | ||
| 79 | 0x20 => 'image/png', | ||
| 80 | 0x21 => 'image/vnd.wap.wbmp', | ||
| 81 | 0x22 => 'application/vnd.wap.multipart.*', | ||
| 82 | 0x23 => 'application/vnd.wap.multipart.mixed', | ||
| 83 | 0x24 => 'application/vnd.wap.multipart.form-data', | ||
| 84 | 0x25 => 'application/vnd.wap.multipart.byteranges', | ||
| 85 | 0x26 => 'application/vnd.wap.multipart.alternative', | ||
| 86 | 0x27 => 'application/xml', | ||
| 87 | 0x28 => 'text/xml', | ||
| 88 | 0x29 => 'application/vnd.wap.wbxml', | ||
| 89 | 0x2A => 'application/x-x968-cross-cert', | ||
| 90 | 0x2B => 'application/x-x968-ca-cert', | ||
| 91 | 0x2C => 'application/x-x968-user-cert', | ||
| 92 | 0x2D => 'text/vnd.wap.si', | ||
| 93 | 0x2E => 'application/vnd.wap.sic', | ||
| 94 | 0x2F => 'text/vnd.wap.sl', | ||
| 95 | 0x30 => 'application/vnd.wap.slc', | ||
| 96 | 0x31 => 'text/vnd.wap.co', | ||
| 97 | 0x32 => 'application/vnd.wap.coc', | ||
| 98 | 0x33 => 'application/vnd.wap.multipart.related', | ||
| 99 | 0x34 => 'application/vnd.wap.sia', | ||
| 100 | 0x35 => 'text/vnd.wap.connectivity-xml', | ||
| 101 | 0x36 => 'application/vnd.wap.connectivity-wbxml', | ||
| 102 | 0x37 => 'application/pkcs7-mime', | ||
| 103 | 0x38 => 'application/vnd.wap.hashed-certificate', | ||
| 104 | 0x39 => 'application/vnd.wap.signed-certificate', | ||
| 105 | 0x3A => 'application/vnd.wap.cert-response', | ||
| 106 | 0x3B => 'application/xhtml+xml', | ||
| 107 | 0x3C => 'application/wml+xml', | ||
| 108 | 0x3D => 'text/css', | ||
| 109 | 0x3E => 'application/vnd.wap.mms-message', | ||
| 110 | 0x3F => 'application/vnd.wap.rollover-certificate', | ||
| 111 | 0x40 => 'application/vnd.wap.locc+wbxml', | ||
| 112 | 0x41 => 'application/vnd.wap.loc+xml', | ||
| 113 | 0x42 => 'application/vnd.syncml.dm+wbxml', | ||
| 114 | 0x43 => 'application/vnd.syncml.dm+xml', | ||
| 115 | 0x44 => 'application/vnd.syncml.notification', | ||
| 116 | 0x45 => 'application/vnd.wap.xhtml+xml', | ||
| 117 | 0x46 => 'application/vnd.wv.csp.cir', | ||
| 118 | 0x47 => 'application/vnd.oma.dd+xml', | ||
| 119 | 0x48 => 'application/vnd.oma.drm.message', | ||
| 120 | 0x49 => 'application/vnd.oma.drm.content', | ||
| 121 | 0x4A => 'application/vnd.oma.drm.rights+xml', | ||
| 122 | 0x4B => 'application/vnd.oma.drm.rights+wbxml', | ||
| 123 | 0x4C => 'application/vnd.wv.csp+xml', | ||
| 124 | 0x4D => 'application/vnd.wv.csp+wbxml', | ||
| 125 | 0x4E => 'application/vnd.syncml.ds.notification', | ||
| 126 | 0x4F => 'audio/*', | ||
| 127 | 0x50 => 'video/*', | ||
| 128 | ); | ||
| 129 | |||
| 130 | sub media_type_for { return $media_type_for{$_[0]}; } | ||
| 131 | } | ||
| 132 | |||
| 133 | sub _quote { | ||
| 134 | my ($s) = @_; | ||
| 135 | $s =~ s/([\\"])/\\$1/g; | ||
| 136 | return '"' . $s . '"'; | ||
| 137 | } | ||
| 138 | |||
| 139 | sub param_encode { # FIXME | ||
| 140 | |||
| 141 | # return _is_token($_[0]) ? $_[0] : _quote($_[0]); | ||
| 142 | return $_[0]; | ||
| 143 | } | ||
| 144 | } |