nexmon – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* export_object_http.c |
2 | * Routines for tracking & saving objects found in HTTP streams |
||
3 | * See also: export_object.c / export_object.h for common code |
||
4 | * Copyright 2007, Stephen Fisher (see AUTHORS file) |
||
5 | * |
||
6 | * Wireshark - Network traffic analyzer |
||
7 | * By Gerald Combs <gerald@wireshark.org> |
||
8 | * Copyright 1998 Gerald Combs |
||
9 | * |
||
10 | * This program is free software; you can redistribute it and/or |
||
11 | * modify it under the terms of the GNU General Public License |
||
12 | * as published by the Free Software Foundation; either version 2 |
||
13 | * of the License, or (at your option) any later version. |
||
14 | * |
||
15 | * This program is distributed in the hope that it will be useful, |
||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
18 | * GNU General Public License for more details. |
||
19 | * |
||
20 | * You should have received a copy of the GNU General Public License |
||
21 | * along with this program; if not, write to the Free Software |
||
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
||
23 | * USA. |
||
24 | */ |
||
25 | |||
26 | #include "config.h" |
||
27 | |||
28 | |||
29 | #include <epan/dissectors/packet-http.h> |
||
30 | #include <epan/tap.h> |
||
31 | |||
32 | #include "export_object.h" |
||
33 | |||
34 | |||
35 | gboolean |
||
36 | eo_http_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, |
||
37 | const void *data) |
||
38 | { |
||
39 | export_object_list_t *object_list = (export_object_list_t *)tapdata; |
||
40 | const http_eo_t *eo_info = (const http_eo_t *)data; |
||
41 | export_object_entry_t *entry; |
||
42 | |||
43 | if(eo_info) { /* We have data waiting for us */ |
||
44 | /* These values will be freed when the Export Object window |
||
45 | * is closed. */ |
||
46 | entry = (export_object_entry_t *)g_malloc(sizeof(export_object_entry_t)); |
||
47 | |||
48 | entry->pkt_num = pinfo->num; |
||
49 | entry->hostname = g_strdup(eo_info->hostname); |
||
50 | entry->content_type = g_strdup(eo_info->content_type); |
||
51 | entry->filename = g_strdup(g_path_get_basename(eo_info->filename)); |
||
52 | entry->payload_len = eo_info->payload_len; |
||
53 | entry->payload_data = (guint8 *)g_memdup(eo_info->payload_data, |
||
54 | eo_info->payload_len); |
||
55 | |||
56 | object_list_add_entry(object_list, entry); |
||
57 | |||
58 | return TRUE; /* State changed - window should be redrawn */ |
||
59 | } else { |
||
60 | return FALSE; /* State unchanged - no window updates needed */ |
||
61 | } |
||
62 | } |
||
63 | |||
64 | /* |
||
65 | * Editor modelines |
||
66 | * |
||
67 | * Local Variables: |
||
68 | * c-basic-offset: 4 |
||
69 | * tab-width: 8 |
||
70 | * indent-tabs-mode: nil |
||
71 | * End: |
||
72 | * |
||
73 | * ex: set shiftwidth=4 tabstop=8 expandtab: |
||
74 | * :indentSize=4:tabSize=8:noTabs=true: |
||
75 | */ |