aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorLev Stipakov <lstipakov@gmail.com>2015-02-08 17:21:18 +0200
committerAnders Broman <a.broman58@gmail.com>2015-02-09 05:22:49 +0000
commitd56a3c9789adbe8dd7fbaeb1232365d11cf1fad7 (patch)
treead46ae51b6b8ff42e8e96b88585c53a92499c6ff /epan
parent8ff944d4ab892521c6a32fe40f6a410640a34d34 (diff)
This adds support for P_DATA_V2 OpenVPN packets.
On the wire P_DATA_V2 is same as P_DATA-V1 plus 3 bytes "peer-id" value after opcode. Client-side support has been added since OpenVPN 2.3.6, server side is in master branch and will appear in 2.4. Peer-id is especially useful for mobile clients (they often float between 3G/Wi-Fi) and in general for Wi-Fi clients (solves UDP NAT timeout issue). Change-Id: Ic5d2e05e62c27bed18c2368a1bbc5c7bf4d358f1 Reviewed-on: https://code.wireshark.org/review/7023 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-openvpn.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/epan/dissectors/packet-openvpn.c b/epan/dissectors/packet-openvpn.c
index 470b294131..e4f9d69876 100644
--- a/epan/dissectors/packet-openvpn.c
+++ b/epan/dissectors/packet-openvpn.c
@@ -58,6 +58,7 @@ void proto_reg_handoff_openvpn(void);
#define P_DATA_V1 6
#define P_CONTROL_HARD_RESET_CLIENT_V2 7
#define P_CONTROL_HARD_RESET_SERVER_V2 8
+#define P_DATA_V2 9
static gint ett_openvpn = -1;
static gint ett_openvpn_data = -1;
@@ -77,6 +78,7 @@ static gint hf_openvpn_pid = -1;
static gint hf_openvpn_plen = -1;
static gint hf_openvpn_rsessionid = -1;
static gint hf_openvpn_sessionid = -1;
+static gint hf_openvpn_peerid = -1;
static gint proto_openvpn = -1;
static dissector_handle_t openvpn_udp_handle;
@@ -102,6 +104,7 @@ static const value_string openvpn_message_types[] =
{ P_DATA_V1, "P_DATA_V1" },
{ P_CONTROL_HARD_RESET_CLIENT_V2, "P_CONTROL_HARD_RESET_CLIENT_V2" },
{ P_CONTROL_HARD_RESET_SERVER_V2, "P_CONTROL_HARD_RESET_SERVER_V2" },
+ { P_DATA_V2, "P_DATA_V2" },
{ 0, NULL }
};
@@ -218,8 +221,12 @@ dissect_openvpn_msg_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *openvp
proto_tree_add_item(type_tree, hf_openvpn_keyid, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- /* if we have a P_CONTROL or P_ACK packet */
- if (openvpn_opcode != P_DATA_V1) {
+ if (openvpn_opcode == P_DATA_V2) {
+ proto_tree_add_item(openvpn_tree, hf_openvpn_peerid, tvb, offset, 3, ENC_BIG_ENDIAN);
+ offset += 3;
+ } else if (openvpn_opcode != P_DATA_V1) {
+ /* if we have a P_CONTROL or P_ACK packet */
+
/* read sessionid */
msg_sessionid = tvb_get_bits32(tvb, offset*8+32, 32, ENC_BIG_ENDIAN);
proto_tree_add_item(openvpn_tree, hf_openvpn_sessionid, tvb, offset, 8, ENC_BIG_ENDIAN);
@@ -449,6 +456,12 @@ proto_register_openvpn(void)
NULL, P_KEY_ID_MASK,
NULL, HFILL }
},
+ { &hf_openvpn_peerid,
+ { "Peer ID", "openvpn.peerid",
+ FT_UINT24, BASE_DEC,
+ NULL, 0x0,
+ NULL, HFILL }
+ },
{ &hf_openvpn_sessionid,
{ "Session ID", "openvpn.sessionid",
FT_UINT64, BASE_DEC,