aboutsummaryrefslogtreecommitdiffstats
path: root/epan/media_params.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-08-21 23:33:23 -0700
committerGuy Harris <guy@alum.mit.edu>2016-08-22 06:34:06 +0000
commit5825f59ddccb8af2b4a06356f61195dd26c977d7 (patch)
tree5250e297808ccc0dd7dd36c688dbba8d53368c75 /epan/media_params.h
parentefdcb25360621e5ac14f276b37964f27f4ce0ba4 (diff)
Pass an HTTP message type to all HTTP subdissectors.
This gets complicated, because those subdissectors might be called by other dissectors as well. We need a better way of passing that sort of out-of-bound information. Pull some routines used for processing Content-Type parameters into common code; we can't guarantee that the media parameters passed in would be writable (passing it as *the* data hid that; passing a structure with that *and* the HTTP message type revealed it), so don't convert it to lower-case in place. Use that information, if available, to determine whether an IPP message is a requet or a response. Change-Id: I4bccc9f05cd0b14ad445be7ab37b3d884d841325 Reviewed-on: https://code.wireshark.org/review/17216 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/media_params.h')
-rw-r--r--epan/media_params.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/epan/media_params.h b/epan/media_params.h
new file mode 100644
index 0000000000..e6f0b98cc0
--- /dev/null
+++ b/epan/media_params.h
@@ -0,0 +1,52 @@
+/* media_params.h
+ * Routines for parsing media type parameters
+ * Copyright 2004, Anders Broman.
+ * Copyright 2004, Olivier Biot.
+ *
+ * Refer to the AUTHORS file or the AUTHORS section in the man page
+ * for contacting the author(s) of this file.
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __MEDIA_PARAMS_H__
+#define __MEDIA_PARAMS_H__
+
+#include <glib.h>
+
+#include "ws_symbol_export.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Return the index of a given char in the given string,
+ * or -1 if not found.
+ */
+WS_DLL_PUBLIC gint
+index_of_char(const char *str, const char c);
+
+WS_DLL_PUBLIC char *
+find_parameter(const char *parameters, const char *key, int *retlen);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* media_params.h */