tcpflow  1.6.1
About: tcpflow is a TCP/IP packet demultiplexer that captures data transmitted as part of TCP connections (flows), and stores the data in a way that is convenient for protocol analysis and debugging.
  Fossies Dox: tcpflow-1.6.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

mime_map.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of tcpflow by Simson Garfinkel <simsong@acm.org>.
3  * Originally by Will Glynn <will@willglynn.com>.
4  *
5  * This source code is under the GNU Public License (GPL) version 3.
6  * See COPYING for details.
7  *
8  */
9 
10 #include "mime_map.h"
11 
12 #include <algorithm>
13 #include <map>
14 
15 std::map<std::string, std::string> mime_map;
16 
18 public:
20 };
21 
23 
25  /* Generated from an OSX-provided mime.types, massaged somewhat by hand */
26  mime_map["application/andrew-inset"] = "ez";
27  mime_map["application/applixware"] = "aw";
28  mime_map["application/atom+xml"] = "atom";
29  mime_map["application/atomcat+xml"] = "atomcat";
30  mime_map["application/atomsvc+xml"] = "atomsvc";
31  mime_map["application/ccxml+xml"] = "ccxml";
32  mime_map["application/cdmi-capability"] = "cdmia";
33  mime_map["application/cdmi-container"] = "cdmic";
34  mime_map["application/cdmi-domain"] = "cdmid";
35  mime_map["application/cdmi-object"] = "cdmio";
36  mime_map["application/cdmi-queue"] = "cdmiq";
37  mime_map["application/cu-seeme"] = "cu";
38  mime_map["application/davmount+xml"] = "davmount";
39  mime_map["application/dssc+der"] = "dssc";
40  mime_map["application/dssc+xml"] = "xdssc";
41  mime_map["application/ecmascript"] = "ecma";
42  mime_map["application/emma+xml"] = "emma";
43  mime_map["application/epub+zip"] = "epub";
44  mime_map["application/exi"] = "exi";
45  mime_map["application/font-tdpfr"] = "pfr";
46  mime_map["application/hyperstudio"] = "stk";
47  mime_map["application/ipfix"] = "ipfix";
48  mime_map["application/java-archive"] = "jar";
49  mime_map["application/java-serialized-object"] = "ser";
50  mime_map["application/java-vm"] = "class";
51  mime_map["application/javascript"] = "js";
52  mime_map["application/json"] = "json";
53  mime_map["application/lost+xml"] = "lostxml";
54  mime_map["application/mac-binhex40"] = "hqx";
55  mime_map["application/mac-compactpro"] = "cpt";
56  mime_map["application/mads+xml"] = "mads";
57  mime_map["application/marc"] = "mrc";
58  mime_map["application/marcxml+xml"] = "mrcx";
59  mime_map["application/mathematica"] = "mb";
60  mime_map["application/mathml+xml"] = "mathml";
61  mime_map["application/mbox"] = "mbox";
62  mime_map["application/mediaservercontrol+xml"] = "mscml";
63  mime_map["application/metalink4+xml"] = "meta4";
64  mime_map["application/mets+xml"] = "mets";
65  mime_map["application/mods+xml"] = "mods";
66  mime_map["application/mp21"] = "mp21";
67  mime_map["application/mp4"] = "mp4s";
68  mime_map["application/msword"] = "doc";
69  mime_map["application/mxf"] = "mxf";
70  mime_map["application/oda"] = "oda";
71  mime_map["application/oebps-package+xml"] = "opf";
72  mime_map["application/ogg"] = "ogx";
73  mime_map["application/onenote"] = "onetoc";
74  mime_map["application/patch-ops-error+xml"] = "xer";
75  mime_map["application/pdf"] = "pdf";
76  mime_map["application/pgp-encrypted"] = "pgp";
77  mime_map["application/pgp-signature"] = "asc";
78  mime_map["application/pics-rules"] = "prf";
79  mime_map["application/pkcs10"] = "p10";
80  mime_map["application/pkcs7-mime"] = "p7m";
81  mime_map["application/pkcs7-signature"] = "p7s";
82  mime_map["application/pkcs8"] = "p8";
83  mime_map["application/pkix-attr-cert"] = "ac";
84  mime_map["application/pkix-cert"] = "cer";
85  mime_map["application/pkix-crl"] = "crl";
86  mime_map["application/pkix-pkipath"] = "pkipath";
87  mime_map["application/pkixcmp"] = "pki";
88  mime_map["application/pls+xml"] = "pls";
89  mime_map["application/postscript"] = "ps";
90  mime_map["application/prs.cww"] = "cww";
91  mime_map["application/pskc+xml"] = "pskcxml";
92  mime_map["application/rdf+xml"] = "rdf";
93  mime_map["application/reginfo+xml"] = "rif";
94  mime_map["application/relax-ng-compact-syntax"] = "rnc";
95  mime_map["application/resource-lists+xml"] = "rl";
96  mime_map["application/resource-lists-diff+xml"] = "rld";
97  mime_map["application/rls-services+xml"] = "rs";
98  mime_map["application/rsd+xml"] = "rsd";
99  mime_map["application/rss+xml"] = "rss";
100  mime_map["application/rtf"] = "rtf";
101  mime_map["application/sbml+xml"] = "sbml";
102  mime_map["application/scvp-cv-request"] = "scq";
103  mime_map["application/scvp-cv-response"] = "scs";
104  mime_map["application/scvp-vp-request"] = "spq";
105  mime_map["application/scvp-vp-response"] = "spp";
106  mime_map["application/sdp"] = "sdp";
107  mime_map["application/set-payment-initiation"] = "setpay";
108  mime_map["application/set-registration-initiation"] = "setreg";
109  mime_map["application/shf+xml"] = "shf";
110  mime_map["application/smil+xml"] = "smil";
111  mime_map["application/sparql-query"] = "rq";
112  mime_map["application/sparql-results+xml"] = "srx";
113  mime_map["application/srgs"] = "gram";
114  mime_map["application/srgs+xml"] = "grxml";
115  mime_map["application/sru+xml"] = "sru";
116  mime_map["application/ssml+xml"] = "ssml";
117  mime_map["application/tei+xml"] = "teicorpus";
118  mime_map["application/thraud+xml"] = "tfi";
119  mime_map["application/timestamped-data"] = "tsd";
120  mime_map["application/vnd.3gpp.pic-bw-large"] = "plb";
121  mime_map["application/vnd.3gpp.pic-bw-small"] = "psb";
122  mime_map["application/vnd.3gpp.pic-bw-var"] = "pvb";
123  mime_map["application/vnd.3gpp2.tcap"] = "tcap";
124  mime_map["application/vnd.3m.post-it-notes"] = "pwn";
125  mime_map["application/vnd.accpac.simply.aso"] = "aso";
126  mime_map["application/vnd.accpac.simply.imp"] = "imp";
127  mime_map["application/vnd.acucobol"] = "acu";
128  mime_map["application/vnd.acucorp"] = "atc";
129  mime_map["application/vnd.adobe.air-application-installer-package+zip"] = "air";
130  mime_map["application/vnd.adobe.fxp"] = "fxp";
131  mime_map["application/vnd.adobe.xdp+xml"] = "xdp";
132  mime_map["application/vnd.adobe.xfdf"] = "xfdf";
133  mime_map["application/vnd.ahead.space"] = "ahead";
134  mime_map["application/vnd.airzip.filesecure.azf"] = "azf";
135  mime_map["application/vnd.airzip.filesecure.azs"] = "azs";
136  mime_map["application/vnd.amazon.ebook"] = "azw";
137  mime_map["application/vnd.americandynamics.acc"] = "acc";
138  mime_map["application/vnd.amiga.ami"] = "ami";
139  mime_map["application/vnd.android.package-archive"] = "apk";
140  mime_map["application/vnd.anser-web-certificate-issue-initiation"] = "cii";
141  mime_map["application/vnd.anser-web-funds-transfer-initiation"] = "fti";
142  mime_map["application/vnd.antix.game-component"] = "atx";
143  mime_map["application/vnd.apple.installer+xml"] = "mpkg";
144  mime_map["application/vnd.apple.mpegurl"] = "m3u8";
145  mime_map["application/vnd.aristanetworks.swi"] = "swi";
146  mime_map["application/vnd.audiograph"] = "aep";
147  mime_map["application/vnd.blueice.multipass"] = "mpm";
148  mime_map["application/vnd.bmi"] = "bmi";
149  mime_map["application/vnd.businessobjects"] = "rep";
150  mime_map["application/vnd.chemdraw+xml"] = "cdxml";
151  mime_map["application/vnd.chipnuts.karaoke-mmd"] = "mmd";
152  mime_map["application/vnd.cinderella"] = "cdy";
153  mime_map["application/vnd.claymore"] = "cla";
154  mime_map["application/vnd.cloanto.rp9"] = "rp9";
155  mime_map["application/vnd.clonk.c4group"] = "c4g";
156  mime_map["application/vnd.cluetrust.cartomobile-config"] = "c11amc";
157  mime_map["application/vnd.cluetrust.cartomobile-config-pkg"] = "c11amz";
158  mime_map["application/vnd.commonspace"] = "csp";
159  mime_map["application/vnd.contact.cmsg"] = "cdbcmsg";
160  mime_map["application/vnd.cosmocaller"] = "cmc";
161  mime_map["application/vnd.crick.clicker"] = "clkx";
162  mime_map["application/vnd.crick.clicker.keyboard"] = "clkk";
163  mime_map["application/vnd.crick.clicker.palette"] = "clkp";
164  mime_map["application/vnd.crick.clicker.template"] = "clkt";
165  mime_map["application/vnd.crick.clicker.wordbank"] = "clkw";
166  mime_map["application/vnd.criticaltools.wbs+xml"] = "wbs";
167  mime_map["application/vnd.ctc-posml"] = "pml";
168  mime_map["application/vnd.cups-ppd"] = "ppd";
169  mime_map["application/vnd.curl.car"] = "car";
170  mime_map["application/vnd.curl.pcurl"] = "pcurl";
171  mime_map["application/vnd.data-vision.rdz"] = "rdz";
172  mime_map["application/vnd.denovo.fcselayout-link"] = "fe_launch";
173  mime_map["application/vnd.dna"] = "dna";
174  mime_map["application/vnd.dolby.mlp"] = "mlp";
175  mime_map["application/vnd.dpgraph"] = "dpg";
176  mime_map["application/vnd.dreamfactory"] = "dfac";
177  mime_map["application/vnd.dvb.ait"] = "ait";
178  mime_map["application/vnd.dvb.service"] = "svc";
179  mime_map["application/vnd.dynageo"] = "geo";
180  mime_map["application/vnd.ecowin.chart"] = "mag";
181  mime_map["application/vnd.enliven"] = "nml";
182  mime_map["application/vnd.epson.esf"] = "esf";
183  mime_map["application/vnd.epson.msf"] = "msf";
184  mime_map["application/vnd.epson.quickanime"] = "qam";
185  mime_map["application/vnd.epson.salt"] = "slt";
186  mime_map["application/vnd.epson.ssf"] = "ssf";
187  mime_map["application/vnd.eszigno3+xml"] = "es3";
188  mime_map["application/vnd.ezpix-album"] = "ez2";
189  mime_map["application/vnd.ezpix-package"] = "ez3";
190  mime_map["application/vnd.fdf"] = "fdf";
191  mime_map["application/vnd.fdsn.mseed"] = "mseed";
192  mime_map["application/vnd.fdsn.seed"] = "seed";
193  mime_map["application/vnd.flographit"] = "gph";
194  mime_map["application/vnd.fluxtime.clip"] = "ftc";
195  mime_map["application/vnd.framemaker"] = "fm";
196  mime_map["application/vnd.frogans.fnc"] = "fnc";
197  mime_map["application/vnd.frogans.ltf"] = "ltf";
198  mime_map["application/vnd.fsc.weblaunch"] = "fsc";
199  mime_map["application/vnd.fujitsu.oasys"] = "oas";
200  mime_map["application/vnd.fujitsu.oasys2"] = "oa2";
201  mime_map["application/vnd.fujitsu.oasys3"] = "oa3";
202  mime_map["application/vnd.fujitsu.oasysgp"] = "fg5";
203  mime_map["application/vnd.fujitsu.oasysprs"] = "bh2";
204  mime_map["application/vnd.fujixerox.ddd"] = "ddd";
205  mime_map["application/vnd.fujixerox.docuworks"] = "xdw";
206  mime_map["application/vnd.fujixerox.docuworks.binder"] = "xbd";
207  mime_map["application/vnd.fuzzysheet"] = "fzs";
208  mime_map["application/vnd.genomatix.tuxedo"] = "txd";
209  mime_map["application/vnd.geogebra.file"] = "ggb";
210  mime_map["application/vnd.geogebra.tool"] = "ggt";
211  mime_map["application/vnd.geometry-explorer"] = "gex";
212  mime_map["application/vnd.geonext"] = "gxt";
213  mime_map["application/vnd.geoplan"] = "g2w";
214  mime_map["application/vnd.geospace"] = "g3w";
215  mime_map["application/vnd.gmx"] = "gmx";
216  mime_map["application/vnd.google-earth.kml+xml"] = "kml";
217  mime_map["application/vnd.google-earth.kmz"] = "kmz";
218  mime_map["application/vnd.grafeq"] = "gqf";
219  mime_map["application/vnd.groove-account"] = "gac";
220  mime_map["application/vnd.groove-help"] = "ghf";
221  mime_map["application/vnd.groove-identity-message"] = "gim";
222  mime_map["application/vnd.groove-injector"] = "grv";
223  mime_map["application/vnd.groove-tool-message"] = "gtm";
224  mime_map["application/vnd.groove-tool-template"] = "tpl";
225  mime_map["application/vnd.groove-vcard"] = "vcg";
226  mime_map["application/vnd.hal+xml"] = "hal";
227  mime_map["application/vnd.handheld-entertainment+xml"] = "zmm";
228  mime_map["application/vnd.hbci"] = "hbci";
229  mime_map["application/vnd.hhe.lesson-player"] = "les";
230  mime_map["application/vnd.hp-hpgl"] = "hpgl";
231  mime_map["application/vnd.hp-hpid"] = "hpid";
232  mime_map["application/vnd.hp-hps"] = "hps";
233  mime_map["application/vnd.hp-jlyt"] = "jlt";
234  mime_map["application/vnd.hp-pcl"] = "pcl";
235  mime_map["application/vnd.hp-pclxl"] = "pclxl";
236  mime_map["application/vnd.hydrostatix.sof-data"] = "sfd-hdstx";
237  mime_map["application/vnd.hzn-3d-crossword"] = "x3d";
238  mime_map["application/vnd.ibm.minipay"] = "mpy";
239  mime_map["application/vnd.ibm.modcap"] = "afp";
240  mime_map["application/vnd.ibm.rights-management"] = "irm";
241  mime_map["application/vnd.ibm.secure-container"] = "sc";
242  mime_map["application/vnd.iccprofile"] = "icc";
243  mime_map["application/vnd.igloader"] = "igl";
244  mime_map["application/vnd.immervision-ivp"] = "ivp";
245  mime_map["application/vnd.immervision-ivu"] = "ivu";
246  mime_map["application/vnd.insors.igm"] = "igm";
247  mime_map["application/vnd.intercon.formnet"] = "xpw";
248  mime_map["application/vnd.intergeo"] = "i2g";
249  mime_map["application/vnd.intu.qbo"] = "qbo";
250  mime_map["application/vnd.intu.qfx"] = "qfx";
251  mime_map["application/vnd.ipunplugged.rcprofile"] = "rcprofile";
252  mime_map["application/vnd.irepository.package+xml"] = "irp";
253  mime_map["application/vnd.is-xpr"] = "xpr";
254  mime_map["application/vnd.isac.fcs"] = "fcs";
255  mime_map["application/vnd.jam"] = "jam";
256  mime_map["application/vnd.jcp.javame.midlet-rms"] = "rms";
257  mime_map["application/vnd.jisp"] = "jisp";
258  mime_map["application/vnd.joost.joda-archive"] = "joda";
259  mime_map["application/vnd.kahootz"] = "ktz";
260  mime_map["application/vnd.kde.karbon"] = "karbon";
261  mime_map["application/vnd.kde.kchart"] = "chrt";
262  mime_map["application/vnd.kde.kformula"] = "kfo";
263  mime_map["application/vnd.kde.kivio"] = "flw";
264  mime_map["application/vnd.kde.kontour"] = "kon";
265  mime_map["application/vnd.kde.kpresenter"] = "kpr";
266  mime_map["application/vnd.kde.kspread"] = "ksp";
267  mime_map["application/vnd.kde.kword"] = "kwd";
268  mime_map["application/vnd.kenameaapp"] = "htke";
269  mime_map["application/vnd.kidspiration"] = "kia";
270  mime_map["application/vnd.kinar"] = "knp";
271  mime_map["application/vnd.koan"] = "skp";
272  mime_map["application/vnd.kodak-descriptor"] = "sse";
273  mime_map["application/vnd.las.las+xml"] = "lasxml";
274  mime_map["application/vnd.llamagraphics.life-balance.desktop"] = "lbd";
275  mime_map["application/vnd.llamagraphics.life-balance.exchange+xml"] = "lbe";
276  mime_map["application/vnd.lotus-1-2-3"] = "123";
277  mime_map["application/vnd.lotus-approach"] = "apr";
278  mime_map["application/vnd.lotus-freelance"] = "pre";
279  mime_map["application/vnd.lotus-notes"] = "nsf";
280  mime_map["application/vnd.lotus-organizer"] = "org";
281  mime_map["application/vnd.lotus-screencam"] = "scm";
282  mime_map["application/vnd.lotus-wordpro"] = "lwp";
283  mime_map["application/vnd.macports.portpkg"] = "portpkg";
284  mime_map["application/vnd.mcd"] = "mcd";
285  mime_map["application/vnd.medcalcdata"] = "mc1";
286  mime_map["application/vnd.mediastation.cdkey"] = "cdkey";
287  mime_map["application/vnd.mfer"] = "mwf";
288  mime_map["application/vnd.mfmp"] = "mfm";
289  mime_map["application/vnd.micrografx.flo"] = "flo";
290  mime_map["application/vnd.micrografx.igx"] = "igx";
291  mime_map["application/vnd.mif"] = "mif";
292  mime_map["application/vnd.mobius.daf"] = "daf";
293  mime_map["application/vnd.mobius.dis"] = "dis";
294  mime_map["application/vnd.mobius.mbk"] = "mbk";
295  mime_map["application/vnd.mobius.mqy"] = "mqy";
296  mime_map["application/vnd.mobius.msl"] = "msl";
297  mime_map["application/vnd.mobius.plc"] = "plc";
298  mime_map["application/vnd.mobius.txf"] = "txf";
299  mime_map["application/vnd.mophun.application"] = "mpn";
300  mime_map["application/vnd.mophun.certificate"] = "mpc";
301  mime_map["application/vnd.mozilla.xul+xml"] = "xul";
302  mime_map["application/vnd.ms-artgalry"] = "cil";
303  mime_map["application/vnd.ms-cab-compressed"] = "cab";
304  mime_map["application/vnd.ms-excel"] = "xls";
305  mime_map["application/vnd.ms-excel.addin.macroenabled.12"] = "xlam";
306  mime_map["application/vnd.ms-excel.sheet.binary.macroenabled.12"] = "xlsb";
307  mime_map["application/vnd.ms-excel.sheet.macroenabled.12"] = "xlsm";
308  mime_map["application/vnd.ms-excel.template.macroenabled.12"] = "xltm";
309  mime_map["application/vnd.ms-fontobject"] = "eot";
310  mime_map["application/vnd.ms-htmlhelp"] = "chm";
311  mime_map["application/vnd.ms-ims"] = "ims";
312  mime_map["application/vnd.ms-lrm"] = "lrm";
313  mime_map["application/vnd.ms-officetheme"] = "thmx";
314  mime_map["application/vnd.ms-pki.seccat"] = "cat";
315  mime_map["application/vnd.ms-pki.stl"] = "stl";
316  mime_map["application/vnd.ms-powerpoint"] = "ppt";
317  mime_map["application/vnd.ms-powerpoint.addin.macroenabled.12"] = "ppam";
318  mime_map["application/vnd.ms-powerpoint.presentation.macroenabled.12"] = "pptm";
319  mime_map["application/vnd.ms-powerpoint.slide.macroenabled.12"] = "sldm";
320  mime_map["application/vnd.ms-powerpoint.slideshow.macroenabled.12"] = "ppsm";
321  mime_map["application/vnd.ms-powerpoint.template.macroenabled.12"] = "potm";
322  mime_map["application/vnd.ms-project"] = "mpp";
323  mime_map["application/vnd.ms-word.document.macroenabled.12"] = "docm";
324  mime_map["application/vnd.ms-word.template.macroenabled.12"] = "dotm";
325  mime_map["application/vnd.ms-works"] = "wps";
326  mime_map["application/vnd.ms-wpl"] = "wpl";
327  mime_map["application/vnd.ms-xpsdocument"] = "xps";
328  mime_map["application/vnd.mseq"] = "mseq";
329  mime_map["application/vnd.musician"] = "mus";
330  mime_map["application/vnd.muvee.style"] = "msty";
331  mime_map["application/vnd.neurolanguage.nlu"] = "nlu";
332  mime_map["application/vnd.noblenet-directory"] = "nnd";
333  mime_map["application/vnd.noblenet-sealer"] = "nns";
334  mime_map["application/vnd.noblenet-web"] = "nnw";
335  mime_map["application/vnd.nokia.n-gage.data"] = "ngdat";
336  mime_map["application/vnd.nokia.n-gage.symbian.install"] = "n-gage";
337  mime_map["application/vnd.nokia.radio-preset"] = "rpst";
338  mime_map["application/vnd.nokia.radio-presets"] = "rpss";
339  mime_map["application/vnd.novadigm.edm"] = "edm";
340  mime_map["application/vnd.novadigm.edx"] = "edx";
341  mime_map["application/vnd.novadigm.ext"] = "ext";
342  mime_map["application/vnd.oasis.opendocument.chart"] = "odc";
343  mime_map["application/vnd.oasis.opendocument.chart-template"] = "otc";
344  mime_map["application/vnd.oasis.opendocument.database"] = "odb";
345  mime_map["application/vnd.oasis.opendocument.formula"] = "odf";
346  mime_map["application/vnd.oasis.opendocument.formula-template"] = "odft";
347  mime_map["application/vnd.oasis.opendocument.graphics"] = "odg";
348  mime_map["application/vnd.oasis.opendocument.graphics-template"] = "otg";
349  mime_map["application/vnd.oasis.opendocument.image"] = "odi";
350  mime_map["application/vnd.oasis.opendocument.image-template"] = "oti";
351  mime_map["application/vnd.oasis.opendocument.presentation"] = "odp";
352  mime_map["application/vnd.oasis.opendocument.presentation-template"] = "otp";
353  mime_map["application/vnd.oasis.opendocument.spreadsheet"] = "ods";
354  mime_map["application/vnd.oasis.opendocument.spreadsheet-template"] = "ots";
355  mime_map["application/vnd.oasis.opendocument.text"] = "odt";
356  mime_map["application/vnd.oasis.opendocument.text-master"] = "odm";
357  mime_map["application/vnd.oasis.opendocument.text-template"] = "ott";
358  mime_map["application/vnd.oasis.opendocument.text-web"] = "oth";
359  mime_map["application/vnd.olpc-sugar"] = "xo";
360  mime_map["application/vnd.oma.dd2+xml"] = "dd2";
361  mime_map["application/vnd.openofficeorg.extension"] = "oxt";
362  mime_map["application/vnd.openxmlformats-officedocument.presentationml.presentation"] = "pptx";
363  mime_map["application/vnd.openxmlformats-officedocument.presentationml.slide"] = "sldx";
364  mime_map["application/vnd.openxmlformats-officedocument.presentationml.slideshow"] = "ppsx";
365  mime_map["application/vnd.openxmlformats-officedocument.presentationml.template"] = "potx";
366  mime_map["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] = "xlsx";
367  mime_map["application/vnd.openxmlformats-officedocument.spreadsheetml.template"] = "xltx";
368  mime_map["application/vnd.openxmlformats-officedocument.wordprocessingml.document"] = "docx";
369  mime_map["application/vnd.openxmlformats-officedocument.wordprocessingml.template"] = "dotx";
370  mime_map["application/vnd.osgeo.mapguide.package"] = "mgp";
371  mime_map["application/vnd.osgi.dp"] = "dp";
372  mime_map["application/vnd.palm"] = "pdb";
373  mime_map["application/vnd.pawaafile"] = "paw";
374  mime_map["application/vnd.pg.format"] = "str";
375  mime_map["application/vnd.pg.osasli"] = "ei6";
376  mime_map["application/vnd.picsel"] = "efif";
377  mime_map["application/vnd.pmi.widget"] = "wg";
378  mime_map["application/vnd.pocketlearn"] = "plf";
379  mime_map["application/vnd.powerbuilder6"] = "pbd";
380  mime_map["application/vnd.previewsystems.box"] = "box";
381  mime_map["application/vnd.proteus.magazine"] = "mgz";
382  mime_map["application/vnd.publishare-delta-tree"] = "qps";
383  mime_map["application/vnd.pvi.ptid1"] = "ptid";
384  mime_map["application/vnd.quark.quarkxpress"] = "qxd";
385  mime_map["application/vnd.realvnc.bed"] = "bed";
386  mime_map["application/vnd.recordare.musicxml"] = "mxl";
387  mime_map["application/vnd.recordare.musicxml+xml"] = "musicxml";
388  mime_map["application/vnd.rig.cryptonote"] = "cryptonote";
389  mime_map["application/vnd.rim.cod"] = "cod";
390  mime_map["application/vnd.rn-realmedia"] = "rm";
391  mime_map["application/vnd.route66.link66+xml"] = "link66";
392  mime_map["application/vnd.sailingtracker.track"] = "st";
393  mime_map["application/vnd.seemail"] = "see";
394  mime_map["application/vnd.sema"] = "sema";
395  mime_map["application/vnd.semd"] = "semd";
396  mime_map["application/vnd.semf"] = "semf";
397  mime_map["application/vnd.shana.informed.formdata"] = "ifm";
398  mime_map["application/vnd.shana.informed.formtemplate"] = "itp";
399  mime_map["application/vnd.shana.informed.interchange"] = "iif";
400  mime_map["application/vnd.shana.informed.package"] = "ipk";
401  mime_map["application/vnd.simtech-mindmapper"] = "twd";
402  mime_map["application/vnd.smaf"] = "mmf";
403  mime_map["application/vnd.smart.teacher"] = "teacher";
404  mime_map["application/vnd.solent.sdkm+xml"] = "sdkm";
405  mime_map["application/vnd.spotfire.dxp"] = "dxp";
406  mime_map["application/vnd.spotfire.sfs"] = "sfs";
407  mime_map["application/vnd.stardivision.calc"] = "sdc";
408  mime_map["application/vnd.stardivision.draw"] = "sda";
409  mime_map["application/vnd.stardivision.impress"] = "sdd";
410  mime_map["application/vnd.stardivision.math"] = "smf";
411  mime_map["application/vnd.stardivision.writer"] = "sdw";
412  mime_map["application/vnd.stardivision.writer-global"] = "sgl";
413  mime_map["application/vnd.stepmania.stepchart"] = "sm";
414  mime_map["application/vnd.sun.xml.calc"] = "sxc";
415  mime_map["application/vnd.sun.xml.calc.template"] = "stc";
416  mime_map["application/vnd.sun.xml.draw"] = "sxd";
417  mime_map["application/vnd.sun.xml.draw.template"] = "std";
418  mime_map["application/vnd.sun.xml.impress"] = "sxi";
419  mime_map["application/vnd.sun.xml.impress.template"] = "sti";
420  mime_map["application/vnd.sun.xml.math"] = "sxm";
421  mime_map["application/vnd.sun.xml.writer"] = "sxw";
422  mime_map["application/vnd.sun.xml.writer.global"] = "sxg";
423  mime_map["application/vnd.sun.xml.writer.template"] = "stw";
424  mime_map["application/vnd.sus-calendar"] = "sus";
425  mime_map["application/vnd.svd"] = "svd";
426  mime_map["application/vnd.symbian.install"] = "sis";
427  mime_map["application/vnd.syncml+xml"] = "xsm";
428  mime_map["application/vnd.syncml.dm+wbxml"] = "bdm";
429  mime_map["application/vnd.syncml.dm+xml"] = "xdm";
430  mime_map["application/vnd.tao.intent-module-archive"] = "tao";
431  mime_map["application/vnd.tmobile-livetv"] = "tmo";
432  mime_map["application/vnd.trid.tpt"] = "tpt";
433  mime_map["application/vnd.triscape.mxs"] = "mxs";
434  mime_map["application/vnd.trueapp"] = "tra";
435  mime_map["application/vnd.ufdl"] = "ufdl";
436  mime_map["application/vnd.uiq.theme"] = "utz";
437  mime_map["application/vnd.umajin"] = "umj";
438  mime_map["application/vnd.unity"] = "unityweb";
439  mime_map["application/vnd.uoml+xml"] = "uoml";
440  mime_map["application/vnd.vcx"] = "vcx";
441  mime_map["application/vnd.visio"] = "vsd";
442  mime_map["application/vnd.visionary"] = "vis";
443  mime_map["application/vnd.vsf"] = "vsf";
444  mime_map["application/vnd.wap.wbxml"] = "wbxml";
445  mime_map["application/vnd.wap.wmlc"] = "wmlc";
446  mime_map["application/vnd.wap.wmlscriptc"] = "wmlsc";
447  mime_map["application/vnd.webturbo"] = "wtb";
448  mime_map["application/vnd.wolfram.player"] = "nbp";
449  mime_map["application/vnd.wordperfect"] = "wpd";
450  mime_map["application/vnd.wqd"] = "wqd";
451  mime_map["application/vnd.wt.stf"] = "stf";
452  mime_map["application/vnd.xara"] = "xar";
453  mime_map["application/vnd.xfdl"] = "xfdl";
454  mime_map["application/vnd.yamaha.hv-dic"] = "hvd";
455  mime_map["application/vnd.yamaha.hv-script"] = "hvs";
456  mime_map["application/vnd.yamaha.hv-voice"] = "hvp";
457  mime_map["application/vnd.yamaha.openscoreformat"] = "osf";
458  mime_map["application/vnd.yamaha.openscoreformat.osfpvg+xml"] = "osfpvg";
459  mime_map["application/vnd.yamaha.smaf-audio"] = "saf";
460  mime_map["application/vnd.yamaha.smaf-phrase"] = "spf";
461  mime_map["application/vnd.yellowriver-custom-menu"] = "cmp";
462  mime_map["application/vnd.zul"] = "zir";
463  mime_map["application/vnd.zzazz.deck+xml"] = "zaz";
464  mime_map["application/voicexml+xml"] = "vxml";
465  mime_map["application/widget"] = "wgt";
466  mime_map["application/winhlp"] = "hlp";
467  mime_map["application/wsdl+xml"] = "wsdl";
468  mime_map["application/wspolicy+xml"] = "wspolicy";
469  mime_map["application/x-7z-compressed"] = "7z";
470  mime_map["application/x-abiword"] = "abw";
471  mime_map["application/x-ace-compressed"] = "ace";
472  mime_map["application/x-authorware-map"] = "aam";
473  mime_map["application/x-authorware-seg"] = "aas";
474  mime_map["application/x-bcpio"] = "bcpio";
475  mime_map["application/x-bittorrent"] = "torrent";
476  mime_map["application/x-bzip"] = "bz";
477  mime_map["application/x-bzip2"] = "bz2";
478  mime_map["application/x-cdlink"] = "vcd";
479  mime_map["application/x-chat"] = "chat";
480  mime_map["application/x-chess-pgn"] = "pgn";
481  mime_map["application/x-cpio"] = "cpio";
482  mime_map["application/x-csh"] = "csh";
483  mime_map["application/x-debian-package"] = "deb";
484  mime_map["application/x-director"] = "dir";
485  mime_map["application/x-doom"] = "wad";
486  mime_map["application/x-dtbncx+xml"] = "ncx";
487  mime_map["application/x-dtbook+xml"] = "dtb";
488  mime_map["application/x-dtbresource+xml"] = "res";
489  mime_map["application/x-dvi"] = "dvi";
490  mime_map["application/x-font-bdf"] = "bdf";
491  mime_map["application/x-font-ghostscript"] = "gsf";
492  mime_map["application/x-font-linux-psf"] = "psf";
493  mime_map["application/x-font-otf"] = "otf";
494  mime_map["application/x-font-pcf"] = "pcf";
495  mime_map["application/x-font-snf"] = "snf";
496  mime_map["application/x-font-ttf"] = "ttf";
497  mime_map["application/x-font-type1"] = "afm";
498  mime_map["application/x-font-woff"] = "woff";
499  mime_map["application/x-futuresplash"] = "spl";
500  mime_map["application/x-gnumeric"] = "gnumeric";
501  mime_map["application/x-gtar"] = "gtar";
502  mime_map["application/x-hdf"] = "hdf";
503  mime_map["application/x-java-jnlp-file"] = "jnlp";
504  mime_map["application/x-latex"] = "latex";
505  mime_map["application/x-mobipocket-ebook"] = "mobi";
506  mime_map["application/x-mpegurl"] = "m3u8";
507  mime_map["application/x-ms-application"] = "application";
508  mime_map["application/x-ms-wmd"] = "wmd";
509  mime_map["application/x-ms-wmz"] = "wmz";
510  mime_map["application/x-ms-xbap"] = "xbap";
511  mime_map["application/x-msaccess"] = "mdb";
512  mime_map["application/x-msbinder"] = "obd";
513  mime_map["application/x-mscardfile"] = "crd";
514  mime_map["application/x-msclip"] = "clp";
515  mime_map["application/x-msmediaview"] = "mvb";
516  mime_map["application/x-msmetafile"] = "wmf";
517  mime_map["application/x-msmoney"] = "mny";
518  mime_map["application/x-mspublisher"] = "pub";
519  mime_map["application/x-msschedule"] = "scd";
520  mime_map["application/x-msterminal"] = "trm";
521  mime_map["application/x-mswrite"] = "wri";
522  mime_map["application/x-netcdf"] = "nc";
523  mime_map["application/x-pkcs12"] = "p12";
524  mime_map["application/x-pkcs7-certificates"] = "p7b";
525  mime_map["application/x-pkcs7-certreqresp"] = "p7r";
526  mime_map["application/x-rar-compressed"] = "rar";
527  mime_map["application/x-sh"] = "sh";
528  mime_map["application/x-shar"] = "shar";
529  mime_map["application/x-shockwave-flash"] = "swf";
530  mime_map["application/x-silverlight-app"] = "xap";
531  mime_map["application/x-stuffit"] = "sit";
532  mime_map["application/x-stuffitx"] = "sitx";
533  mime_map["application/x-sv4cpio"] = "sv4cpio";
534  mime_map["application/x-sv4crc"] = "sv4crc";
535  mime_map["application/x-tar"] = "tar";
536  mime_map["application/x-tcl"] = "tcl";
537  mime_map["application/x-tex"] = "tex";
538  mime_map["application/x-tex-tfm"] = "tfm";
539  mime_map["application/x-texinfo"] = "texi";
540  mime_map["application/x-ustar"] = "ustar";
541  mime_map["application/x-wais-source"] = "src";
542  mime_map["application/x-x509-ca-cert"] = "crt";
543  mime_map["application/x-xfig"] = "fig";
544  mime_map["application/x-xpinstall"] = "xpi";
545  mime_map["application/xcap-diff+xml"] = "xdf";
546  mime_map["application/xenc+xml"] = "xenc";
547  mime_map["application/xhtml+xml"] = "xhtml";
548  mime_map["application/xml"] = "xml";
549  mime_map["application/xml-dtd"] = "dtd";
550  mime_map["application/xop+xml"] = "xop";
551  mime_map["application/xslt+xml"] = "xslt";
552  mime_map["application/xspf+xml"] = "xspf";
553  mime_map["application/xv+xml"] = "xvml";
554  mime_map["application/yang"] = "yang";
555  mime_map["application/yin+xml"] = "yin";
556  mime_map["application/zip"] = "zip";
557  mime_map["audio/adpcm"] = "adp";
558  mime_map["audio/basic"] = "au";
559  mime_map["audio/midi"] = "mid";
560  mime_map["audio/mp4"] = "mp4a";
561  mime_map["audio/mp4a-latm"] = "m4a";
562  mime_map["audio/mpeg"] = "mpga";
563  mime_map["audio/ogg"] = "ogg";
564  mime_map["audio/vnd.dece.audio"] = "uvva";
565  mime_map["audio/vnd.digital-winds"] = "eol";
566  mime_map["audio/vnd.dra"] = "dra";
567  mime_map["audio/vnd.dts"] = "dts";
568  mime_map["audio/vnd.dts.hd"] = "dtshd";
569  mime_map["audio/vnd.lucent.voice"] = "lvp";
570  mime_map["audio/vnd.ms-playready.media.pya"] = "pya";
571  mime_map["audio/vnd.nuera.ecelp4800"] = "ecelp4800";
572  mime_map["audio/vnd.nuera.ecelp7470"] = "ecelp7470";
573  mime_map["audio/vnd.nuera.ecelp9600"] = "ecelp9600";
574  mime_map["audio/vnd.rip"] = "rip";
575  mime_map["audio/webm"] = "weba";
576  mime_map["audio/x-aac"] = "aac";
577  mime_map["audio/x-aiff"] = "aiff";
578  mime_map["audio/x-mpegurl"] = "m3u";
579  mime_map["audio/x-ms-wax"] = "wax";
580  mime_map["audio/x-ms-wma"] = "wma";
581  mime_map["audio/x-pn-realaudio"] = "ram";
582  mime_map["audio/x-pn-realaudio-plugin"] = "rmp";
583  mime_map["audio/x-wav"] = "wav";
584  mime_map["chemical/x-cdx"] = "cdx";
585  mime_map["chemical/x-cif"] = "cif";
586  mime_map["chemical/x-cmdf"] = "cmdf";
587  mime_map["chemical/x-cml"] = "cml";
588  mime_map["chemical/x-csml"] = "csml";
589  mime_map["chemical/x-xyz"] = "xyz";
590  mime_map["image/bmp"] = "bmp";
591  mime_map["image/cgm"] = "cgm";
592  mime_map["image/g3fax"] = "g3";
593  mime_map["image/gif"] = "gif";
594  mime_map["image/ief"] = "ief";
595  mime_map["image/jp2"] = "jp2";
596  mime_map["image/jpeg"] = "jpg";
597  mime_map["image/ktx"] = "ktx";
598  mime_map["image/pict"] = "pict";
599  mime_map["image/png"] = "png";
600  mime_map["image/prs.btif"] = "btif";
601  mime_map["image/svg+xml"] = "svg";
602  mime_map["image/tiff"] = "tiff";
603  mime_map["image/vnd.adobe.photoshop"] = "psd";
604  mime_map["image/vnd.dece.graphic"] = "uvi";
605  mime_map["image/vnd.djvu"] = "djvu";
606  mime_map["image/vnd.dvb.subtitle"] = "sub";
607  mime_map["image/vnd.dwg"] = "dwg";
608  mime_map["image/vnd.dxf"] = "dxf";
609  mime_map["image/vnd.fastbidsheet"] = "fbs";
610  mime_map["image/vnd.fpx"] = "fpx";
611  mime_map["image/vnd.fst"] = "fst";
612  mime_map["image/vnd.fujixerox.edmics-mmr"] = "mmr";
613  mime_map["image/vnd.fujixerox.edmics-rlc"] = "rlc";
614  mime_map["image/vnd.ms-modi"] = "mdi";
615  mime_map["image/vnd.net-fpx"] = "npx";
616  mime_map["image/vnd.wap.wbmp"] = "wbmp";
617  mime_map["image/vnd.xiff"] = "xif";
618  mime_map["image/webp"] = "webp";
619  mime_map["image/x-cmu-raster"] = "ras";
620  mime_map["image/x-cmx"] = "cmx";
621  mime_map["image/x-freehand"] = "fh";
622  mime_map["image/x-icon"] = "ico";
623  mime_map["image/x-macpaint"] = "pntg";
624  mime_map["image/x-pcx"] = "pcx";
625  mime_map["image/x-pict"] = "pict";
626  mime_map["image/x-portable-anymap"] = "pnm";
627  mime_map["image/x-portable-bitmap"] = "pbm";
628  mime_map["image/x-portable-graymap"] = "pgm";
629  mime_map["image/x-portable-pixmap"] = "ppm";
630  mime_map["image/x-quicktime"] = "qtif";
631  mime_map["image/x-rgb"] = "rgb";
632  mime_map["image/x-xbitmap"] = "xbm";
633  mime_map["image/x-xpixmap"] = "xpm";
634  mime_map["image/x-xwindowdump"] = "xwd";
635  mime_map["message/rfc822"] = "eml";
636  mime_map["model/iges"] = "iges";
637  mime_map["model/mesh"] = "mesh";
638  mime_map["model/vnd.collada+xml"] = "dae";
639  mime_map["model/vnd.dwf"] = "dwf";
640  mime_map["model/vnd.gdl"] = "gdl";
641  mime_map["model/vnd.gtw"] = "gtw";
642  mime_map["model/vnd.mts"] = "mts";
643  mime_map["model/vnd.vtu"] = "vtu";
644  mime_map["model/vrml"] = "vrml";
645  mime_map["text/cache-manifest"] = "manifest";
646  mime_map["text/calendar"] = "ics";
647  mime_map["text/css"] = "css";
648  mime_map["text/csv"] = "csv";
649  mime_map["text/html"] = "html";
650  mime_map["text/n3"] = "n3";
651  mime_map["text/plain"] = "txt";
652  mime_map["text/prs.lines.tag"] = "dsc";
653  mime_map["text/richtext"] = "rtx";
654  mime_map["text/sgml"] = "sgml";
655  mime_map["text/tab-separated-values"] = "tsv";
656  mime_map["text/troff"] = "roff";
657  mime_map["text/turtle"] = "ttl";
658  mime_map["text/uri-list"] = "urls";
659  mime_map["text/vnd.curl"] = "curl";
660  mime_map["text/vnd.curl.dcurl"] = "dcurl";
661  mime_map["text/vnd.curl.mcurl"] = "mcurl";
662  mime_map["text/vnd.curl.scurl"] = "scurl";
663  mime_map["text/vnd.fly"] = "fly";
664  mime_map["text/vnd.fmi.flexstor"] = "flx";
665  mime_map["text/vnd.graphviz"] = "gv";
666  mime_map["text/vnd.in3d.3dml"] = "3dml";
667  mime_map["text/vnd.in3d.spot"] = "spot";
668  mime_map["text/vnd.sun.j2me.app-descriptor"] = "jad";
669  mime_map["text/vnd.wap.wml"] = "wml";
670  mime_map["text/vnd.wap.wmlscript"] = "wmls";
671  mime_map["text/x-asm"] = "asm";
672  mime_map["text/x-c"] = "c";
673  mime_map["text/x-fortran"] = "f";
674  mime_map["text/x-java-source"] = "java";
675  mime_map["text/x-pascal"] = "pas";
676  mime_map["text/x-setext"] = "etx";
677  mime_map["text/x-uuencode"] = "uu";
678  mime_map["text/x-vcalendar"] = "vcs";
679  mime_map["text/x-vcard"] = "vcf";
680  mime_map["video/3gpp"] = "3gp";
681  mime_map["video/3gpp2"] = "3g2";
682  mime_map["video/h261"] = "h261";
683  mime_map["video/h263"] = "h263";
684  mime_map["video/h264"] = "h264";
685  mime_map["video/jpeg"] = "jpgv";
686  mime_map["video/jpm"] = "jpm";
687  mime_map["video/mj2"] = "mj2";
688  mime_map["video/mp2t"] = "ts";
689  mime_map["video/mp4"] = "m4v";
690  mime_map["video/mpeg"] = "mpg";
691  mime_map["video/ogg"] = "ogv";
692  mime_map["video/quicktime"] = "mov";
693  mime_map["video/vnd.dece.hd"] = "uvvh";
694  mime_map["video/vnd.dece.mobile"] = "uvvm";
695  mime_map["video/vnd.dece.pd"] = "uvvp";
696  mime_map["video/vnd.dece.sd"] = "uvvs";
697  mime_map["video/vnd.dece.video"] = "uvvv";
698  mime_map["video/vnd.fvt"] = "fvt";
699  mime_map["video/vnd.mpegurl"] = "m4u";
700  mime_map["video/vnd.ms-playready.media.pyv"] = "pyv";
701  mime_map["video/vnd.uvvu.mp4"] = "uvvu";
702  mime_map["video/vnd.vivo"] = "viv";
703  mime_map["video/webm"] = "webm";
704  mime_map["video/x-dv"] = "dv";
705  mime_map["video/x-f4v"] = "f4v";
706  mime_map["video/x-fli"] = "fli";
707  mime_map["video/x-flv"] = "flv";
708  mime_map["video/x-m4v"] = "m4v";
709  mime_map["video/x-ms-asf"] = "asf";
710  mime_map["video/x-ms-wm"] = "wm";
711  mime_map["video/x-ms-wmv"] = "wmv";
712  mime_map["video/x-ms-wmx"] = "wmx";
713  mime_map["video/x-ms-wvx"] = "wvx";
714  mime_map["video/x-msvideo"] = "avi";
715  mime_map["video/x-sgi-movie"] = "movie";
716  mime_map["x-conference/x-cooltalk"] = "ice";
717 }
718 
719 std::string get_extension_for_mime_type(const std::string& mime_type) {
720  /* Strip anything after a semicolon (e.g. text/html; charset=utf-8) */
721  std::string base_type(mime_type);
722  size_t semicolon_pos = base_type.find_first_of(";");
723  if (semicolon_pos != std::string::npos) {
724  base_type = base_type.substr(0, semicolon_pos);
725  }
726 
727  /* Downcase it for comparsion purposes */
728  std::transform(base_type.begin(), base_type.end(), base_type.begin(), ::tolower);
729 
730  /* Look it up in the map */
731  return mime_map[base_type];
732 }
std::map< std::string, std::string > mime_map
Definition: mime_map.cpp:15
static PopulateMimeMap populate_mime_map
Definition: mime_map.cpp:22
std::string get_extension_for_mime_type(const std::string &mime_type)
Definition: mime_map.cpp:719