2 * Routines for RFC2634 Extended Security Services packet dissection
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include <epan/packet.h>
36 #include "packet-ber.h"
37 #include "packet-pkixtsp.h"
38 #include "packet-pkix1explicit.h"
39 #include "packet-pkix1implicit.h"
40 #include "packet-cms.h"
42 #define PNAME "PKIX Time Stamp Protocol"
43 #define PSNAME "PKIXTSP"
44 #define PFNAME "pkixtsp"
46 /* Initialize the protocol and registered fields */
47 static int proto_pkixtsp = -1;
48 #include "packet-pkixtsp-hf.c"
50 /* Initialize the subtree pointers */
51 static gint ett_pkixtsp = -1;
52 #include "packet-pkixtsp-ett.c"
55 #include "packet-pkixtsp-fn.c"
59 dissect_timestamp_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
61 proto_item *item=NULL;
62 proto_tree *tree=NULL;
64 if (check_col(pinfo->cinfo, COL_PROTOCOL))
65 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIXTSP");
67 if (check_col(pinfo->cinfo, COL_INFO)) {
68 col_clear(pinfo->cinfo, COL_INFO);
70 col_add_fstr(pinfo->cinfo, COL_INFO, "Reply");
75 item=proto_tree_add_item(parent_tree, proto_pkixtsp, tvb, 0, -1, FALSE);
76 tree = proto_item_add_subtree(item, ett_pkixtsp);
79 return dissect_pkixtsp_TimeStampResp(FALSE, tvb, 0, pinfo, tree, -1);
83 dissect_timestamp_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
85 proto_item *item=NULL;
86 proto_tree *tree=NULL;
88 if (check_col(pinfo->cinfo, COL_PROTOCOL))
89 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIXTSP");
91 if (check_col(pinfo->cinfo, COL_INFO)) {
92 col_clear(pinfo->cinfo, COL_INFO);
94 col_add_fstr(pinfo->cinfo, COL_INFO, "Query");
99 item=proto_tree_add_item(parent_tree, proto_pkixtsp, tvb, 0, -1, FALSE);
100 tree = proto_item_add_subtree(item, ett_pkixtsp);
103 return dissect_pkixtsp_TimeStampReq(FALSE, tvb, 0, pinfo, tree, -1);
107 /*--- proto_register_pkixtsp ----------------------------------------------*/
108 void proto_register_pkixtsp(void) {
111 static hf_register_info hf[] = {
112 #include "packet-pkixtsp-hfarr.c"
115 /* List of subtrees */
116 static gint *ett[] = {
118 #include "packet-pkixtsp-ettarr.c"
121 /* Register protocol */
122 proto_pkixtsp = proto_register_protocol(PNAME, PSNAME, PFNAME);
124 /* Register fields and subtrees */
125 proto_register_field_array(proto_pkixtsp, hf, array_length(hf));
126 proto_register_subtree_array(ett, array_length(ett));
131 /*--- proto_reg_handoff_pkixtsp -------------------------------------------*/
132 void proto_reg_handoff_pkixtsp(void) {
133 dissector_handle_t timestamp_reply_handle;
134 dissector_handle_t timestamp_query_handle;
136 timestamp_reply_handle = new_create_dissector_handle(dissect_timestamp_reply, proto_pkixtsp);
137 dissector_add_string("media_type", "application/timestamp-reply", timestamp_reply_handle);
139 timestamp_query_handle = new_create_dissector_handle(dissect_timestamp_query, proto_pkixtsp);
140 dissector_add_string("media_type", "application/timestamp-query", timestamp_query_handle);
142 /*#include "packet-pkixtsp-dis-tab.c"*/