1 /******************************************************************************
2 ** Copyright (C) 2006-2007 ascolab GmbH. All Rights Reserved.
3 ** Web: http://www.ascolab.com
5 ** This program is free software; you can redistribute it and/or
6 ** modify it under the terms of the GNU General Public License
7 ** as published by the Free Software Foundation; either version 2
8 ** of the License, or (at your option) any later version.
10 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13 ** Project: OpcUa Wireshark Plugin
15 ** Description: OpcUa Security Layer Decoder.
17 ** Author: Gerhard Gappmeier <gerhard.gappmeier@ascolab.com>
18 ******************************************************************************/
22 #include <epan/packet.h>
23 #include "opcua_security_layer.h"
25 static int hf_opcua_security_tokenid = -1;
26 static int hf_opcua_security_seq = -1;
27 static int hf_opcua_security_rqid = -1;
29 /** Register security layer types. */
30 void registerSecurityLayerTypes(int proto)
32 static hf_register_info hf[] =
34 /* id full name abbreviation type display strings bitmask blurb HFILL */
35 {&hf_opcua_security_tokenid, {"Security Token Id", "opcua.security.tokenid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},
36 {&hf_opcua_security_seq, {"Security Sequence Number", "opcua.security.seq", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},
37 {&hf_opcua_security_rqid, {"Security RequestId", "opcua.security.rqid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}
39 proto_register_field_array(proto, hf, array_length(hf));
42 /* Security Layer: message parsers
43 * Only works for Security Policy "NoSecurity" at the moment.
45 void parseSecurityLayer(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
47 proto_tree_add_item(tree, hf_opcua_security_tokenid, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
48 proto_tree_add_item(tree, hf_opcua_security_seq, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
49 proto_tree_add_item(tree, hf_opcua_security_rqid, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
53 * Editor modelines - http://www.wireshark.org/tools/modelines.html
58 * indent-tabs-mode: nil
61 * vi: set shiftwidth=4 tabstop=8 expandtab:
62 * :indentSize=4:tabSize=8:noTabs=true: